Platform SDK: Active Directory, ADSI, and Directory Services

IADsWinNTSystemInfo

The IADsWinNTSystemInfo interface lets you retrieve the Windows NT® 4.0 system information on a computer running Windows® 2000. Such system information includes user account name, user domain, host name and the primary domain controller of the host machine.

The IADsWinNTSystemInfo interface is implemented on the WinNTSystemInfo object residing in activeds.dll, which comes with the standard installation of ADSI on Windows 2000. You must explicitly create an instance of the WinNTSystemInfo object in order to call the methods on the IADsWinNTSystemInfo interface. This requirement means creating an WinNTSystemInfo instance with the CoCreateInstance function in C/C++:

IADsWinNTSystemInfo *pNTsys;
HRESULT hr = CoCreateInstance(CLSID_WinNTSystemInfo,
                              NULL,
                              CLSCTX_INPROC_SERVER,
                              IID_IADsWinNTSystemInfo,
                              (void**)&pNTsys);

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

Dim ntSys as New WinNTSystemInfo

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

Dim ntSys
Set ntSys = CreateObject("WinNTSystemInfo")

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.

IADsWinNTSystemInfo Property Methods Description
get_UserName Retrieves the name of the user account under which the method is called.
get_ComputerName Retrieves the host name of the computer.
get_DomainName Retrieves the domain name the user is on.
get_PDC Retrieves the name of the primary domain controller to which the host computer belongs.

Requirements

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

See Also

IADsWinNTSystemInfo Property Methods, CoCreateInstance