Platform SDK: Active Directory, ADSI, and Directory Services

IADsADSystemInfo

The IADsADSystemInfo interface provides you with an ability to retrieve the Windows® 2000 system information, such as user account name, user domain, site name, related to a Windows 2000 computer belonging to an Active Directory™ domain.

The IADsADSystemInfo interface is implemented on the ADSystemInfo object residing in activeds.dll, which comes 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

IUnknown Methods Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments reference count.
Release Decrements reference count.

IDispatch Methods Description
GetTypeInfoCount Gets the number of type descriptions.
GetTypeInfo Gets a description of the object's programmable interface.
GetIDsOfNames Maps the name of the method or property to the DISPID.
Invoke Calls one of the object's methods or gets and sets one of its properties.

IADsADSystemInfo Properties and Methods Description
get_UserName Retrieves the name of the user account under which the system information is requested.
get_ComputerName Retrieves the host name of the computer.
get_SiteName Retrieves the site name.
get_DomainShortName Retrieves the short version of the domain name, such as "myDom".
get_DomainDNSName Retrieves the domain name service (DNS) name of the domain, such as "myDom.myCom,com"
get_ForestDNSName Retrieves the DNS name of the forest.
get_PDCRoleOwner Retrieves the owner of the primary domain controller role.
get_SchemaRoleOwner Retrieves the owner of the schema role.
get_IsNativeMode Determines if the Active Directory domain is native or mixed.
GetAnyDCName Retrieves the name of a domain controller.
GetDCSiteName Retrieves the name of a site.
RefresheSchemaCache Refreshes the schema cache.
GetTrees Retrieves all the directory trees within the forest.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Iads.h.

See Also

IADsADSystemInfo Property Methods, CoCreateInstance