Directory Services |
The IADsWinNTSystemInfo interface retrieves the Windows NT 4.0 system information about a computer running on the Windows 2000 operating system. 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 is included in the standard installation of ADSI for Windows 2000. You must explicitly create an instance of the WinNTSystemInfo object 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
You can also call the CreateObject function in a scripting environment, supplying "WinNTSystemInfo" as the ProgID:
Dim ntSys Set ntSys = CreateObject("WinNTSystemInfo")
The IADsWinNTSystemInfo interface inherits the methods of the standard COM interfaces:
In addition, IADsWinNTSystemInfo defines the following methods.
Method | 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 that the user is on. |
get_PDC | Retrieves the name of the primary domain controller to which the host computer belongs. |
The IADsWinNTSystemInfo interface defines the following properties. The preceding table includes access methods for these properties.
Property | Description |
---|---|
ComputerName | Retrieves the host name of the computer. |
DomainName | Retrieves the domain name that the user is on. |
PDC | Retrieves the name of the primary domain controller to which the host computer belongs. |
UserName | Retrieves the name of the user account under which the method is called. |
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Header: Declared in Iads.h.
IADsWinNTSystemInfo Property Methods, CoCreateInstance