Directory Services

IADsADSystemInfo

The IADsADSystemInfo interface gets data about the local computer if it is a Windows® 2000 computer in a Windows 2000 domain. For example, you can get the domain, site, and distinguished name of the local computer.

The IADsADSystemInfo interface is implemented on the ADSystemInfo object residing in adsldp.dll, which is included with the standard installation of ADSI on Windows 2000. You must explicitly create an instance of the ADSystemInfo object in order to call the methods on the IADsADSystemInfo interface. This requirement amounts to creating an ADSystemInfo instance with the CoCreateInstance function in C/C++:

IADsADSystemInfo *pADsys;
HRESULT hr = CoCreateInstance(CLSID_ADSystemInfo,
							NULL,
							CLSCTX_INPROC_SERVER,
							IID_IADsADSystemInfo,
							(void**)&pADsys);

You can also use the New operator in Visual Basic®:

Dim adSys as New ADSystemInfo

Or you can call the CreateObject function in a scripting environment, supplying "ADSystemInfo" as the ProgID:

Dim adSys
Set adSys = CreateObject("ADSystemInfo")

Methods in Vtable Order

The IADsADSystemInfo interface inherits the methods of the standard COM interfaces:

In addition, IADsADSystemInfo defines the following methods.

Method Description
get_UserName Retrieves the Active Directory distinguished name of the current user, which is the logged-on user or the user impersonated by the calling thread.
get_ComputerName Retrieves the distinguished name of the local computer.
get_SiteName Retrieves the site name of the local computer.
get_DomainShortName Retrieves the short name of the local computer's domain, for example "myDom".
get_DomainDNSName Retrieves the DNS name of the local computer's domain, for example "example.fabrikam.com".
get_ForestDNSName Retrieves the DNS name of the local computer's forest.
get_PDCRoleOwner 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.
get_SchemaRoleOwner Retrieves the distinguished name of the NTDS-DSA object for the DC that owns the schema role in the local computer's forest.
get_IsNativeMode Determines whether the local computer's domain is in native or mixed mode.
GetAnyDCName Retrieves the DNS name of a domain controller in the local computer's domain.
GetDCSiteName Retrieves the name of the local computer's site.
RefreshSchemaCache Refreshes ADSI's Active Directory schema cache on the local computer.
GetTrees Retrieves the DNS names of all the directory trees in the local computer's forest.

Properties

The IADsADSystemInfo interface defines the following properties. The preceding table includes access methods for these properties.

Property Description
ComputerName Retrieves the distinguished name of the local computer.
DomainDNSName Retrieves the DNS name of the local computer's domain, for example "example.fabrikam.com".
DomainShortName Retrieves the short name of the local computer's domain, for example "myDom".
ForestDNSName Retrieves the DNS name of the local computer's forest.
IsNativeMode Determines whether the local computer's domain is in native or mixed mode.
PDCRoleOwner 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.
SchemaRoleOwner Retrieves the distinguished name of the NTDS-DSA object for the DC that owns the schema role in the local computer's forest.
SiteName Retrieves the site name of the local computer.
UserName Retrieves the Active Directory® distinguished name of the current user, which is the logged-on user or the user impersonated by the calling thread.

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Header: Declared in Iads.h.

See Also

IADsADSystemInfo Property Methods, CoCreateInstance