WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI LDAP CDO
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

ADSystemInfo Interface


The IADsADSystemInfo interface gets data about the local computer if it is a Windows 2000/XP computer in a Windows 2000/XP domain. For example, you can get the domain, site, and distinguished name of the local computer.
;Requires Windows XP or Windows 2000 Professional.
adSys = ObjectOpen("ADSystemInfo")
;Retrieves the Active Directory distinguished name of the current user, which is the logged-on user 
;or the user impersonated by the calling thread. 
userName = adSys.UserName
Message("Username",userName)
;Retrieves the distinguished name of the local computer. 
Computername = adSys.Computername
Message("Computername",Computername)
;Retrieves the DNS name of the local computer's domain, for example "example.fabrikam.com". 
DomainDNSName = adSys.DomainDNSName
Message("DomainDNSName",DomainDNSName)
;Retrieves the short name of the local computer's domain, for example "myDom". 
DomainShortName = adSys.DomainShortName
Message("DomainShortName",DomainShortName)
;Retrieves the DNS name of the local computer's forest. 
ForestDNSName = adSys.ForestDNSName
Message("ForestDNSName",ForestDNSName)
;Determines whether the local computer's domain is in native or mixed mode. 
IsNativeMode = adSys.IsNativeMode
Message("IsNativeMode",IsNativeMode)
;Retrieves the distinguished name of the NTDS-DSA object for the DC that owns the 
;primary domain controller role in the local computer's domain. 
PDCRoleOwner = adSys.PDCRoleOwner
Message("PDCRoleOwner",PDCRoleOwner)
;Retrieves the distinguished name of the NTDS-DSA object for the DC that owns the schema role in the local computer's forest. 
SchemaRoleOwner = adSys.SchemaRoleOwner
Message("SchemaRoleOwner",SchemaRoleOwner)
;Retrieves the site name of the local computer. 
SiteName = adSys.SiteName
Message("SiteName",SiteName)
ObjectClose(adSys)

Article ID:   W16087
File Created: 2004:03:30:15:42:46
Last Updated: 2004:03:30:15:42:46