IADsComputer Property Methods
The IADsComputer interface methods read and write the properties described in this topic. For more information, see Interface Property Methods.
Properties
-
ComputerID
-
-
Access type: Read-only
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_ComputerID( [out] BSTR* pbstrComputerID );
The globally unique identifier assigned to each computer.
-
-
Department
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Department( [out] BSTR* pbstrDepartment ); HRESULT put_Department( [in] BSTR bstrDepartment );
The organizational unit (OU), such as department, that this computer belongs to.
-
-
Description
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Description( [out] BSTR* pbstrDescription ); HRESULT put_Description( [in] BSTR bstrDescription );
The description of this computer.
-
-
Division
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Division( [out] BSTR* pbstrDivision ); HRESULT put_Division( [in] BSTR bstrDivision );
The division, within an organization, that this computer belongs to.
-
-
Location
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Location( [out] BSTR* pbstrLocation ); HRESULT put_Location( [in] BSTR bstrLocation );
The assigned physical location of this computer.
-
-
MemorySize
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_MemorySize( [out] BSTR* pbstrMemorySize ); HRESULT put_MemorySize( [in] BSTR bstrMemorySize );
The size, in megabytes, of random access memory for this computer.
-
-
Model
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Model( [out] BSTR* pbstrModel ); HRESULT put_Model( [in] BSTR bstrModel );
The make and model of this computer.
-
-
NetAddresses
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_NetAddresses( [out] VARIANT* pvNetAddresses ); HRESULT put_NetAddresses( [in] VARIANT vNetAddresses );
An array of NetAddress fields that represent the addresses by which this computer can be reached. NetAddress is a provider-specific BSTR composed of two substrings separated by a colon (:). The left substring indicates the address type, and the right substring is a string representation of an address of that type. For example, TCP/IP addresses are of the form: IP:100.201.301.45. IPX type addresses are of the form: IPX:10.123456.80.
-
-
OperatingSystem
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_OperatingSystem( [out] BSTR* pbstrOperatingSystem ); HRESULT put_OperatingSystem( [in] BSTR bstrOperatingSystem );
The operating system used on this computer.
-
-
OperatingSystemVersion
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_OperatingSystemVersion( [out] BSTR* pbstrOperatingSystemVersion ); HRESULT put_OperatingSystemVersion( [in] BSTR bstrOperatingSystemVersion );
The version of the operating system used on this computer.
-
-
Owner
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Owner( [out] BSTR* pbstrOwner ); HRESULT put_Owner( [in] BSTR bstrOwner );
The person to whom this computer is assigned. This person should also have a license to run the installed software.
-
-
PrimaryUser
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_PrimaryUser( [out] BSTR* pbstrPrimaryUser ); HRESULT put_PrimaryUser( [in] BSTR bstrPrimaryUser );
The name of the contact person, such as an administrator, for this computer.
-
-
Processor
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Processor( [out] BSTR* pbstrProcessor ); HRESULT put_Processor( [in] BSTR bstrProcessor );
The processor type.
-
-
ProcessorCount
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_ProcessorCount( [out] BSTR* pbstrProcessorCount ); HRESULT put_ProcessorCount( [in] BSTR bstrProcessorCount );
The number of installed processors.
-
-
Role
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Role( [out] BSTR* pbstrRole ); HRESULT put_Role( [in] BSTR bstrRole );
The role of this computer, for example, workstation, server, or domain controller.
-
-
Site
-
-
Access type: Read-only
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Site( [out] BSTR* pbstrSite );
The globally unique identifier that identifies the site that this computer was installed in. A site is a physical region of good connectivity in a network.
-
-
StorageCapacity
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_StorageCapacity( [out] BSTR* pbstrStorageCapacity ); HRESULT put_StorageCapacity( [in] BSTR bstrStorageCapacity );
The size, in megabytes, of the disk.
-
Remarks
Different providers may choose to expose different properties of a computer object. For more information, see ADSI System Providers.
You can discover what properties are supported by inspecting the mandatory and optional properties through its schema class. For more information, see the IADsClass interface.
To examine the status of a computer or to perform the shutdown operation across the network, you must use the IADsComputerOperations interface.
Examples
The following Visual Basic code example examines computer properties supported by the ADSI WinNT provider.
Dim obj As IADs
On Error Resume Next
Set obj = GetObject("WinNT://myMachine,computer")
If (obj.Class = "Computer") Then
MsgBox "Computer owner: " & obj.owner
MsgBox "Computer division: " & obj.Division
MsgBox "Computer operatingSystem: " & obj.OperatingSystem
MsgBox "Computer operating System Version: " & obj.OperatingSystemVersion
MsgBox "Computer processor: " & obj.Processor
MsgBox "Computer processor Count: " & obj.ProcessorCount
End If
The following C++ code example examines computer properties supported by the ADSI WinNT provider.
IADsComputer *pComp = NULL;
LPWSTR adspath = L"WinNT://jeffsmith1,computer";
HRESULT hr = S_OK;
BSTR bstr = NULL;
hr = ADsGetObject(adspath,IID_IADsComputer,(void**)&pComp);
if(FAILED(hr)) {goto Cleanup;}
hr = pComp->get_Owner(&bstr);
if(FAILED(hr)) {goto Cleanup;}
printf("Computer owner: %S\n",bstr);
SysFreeString(bstr);
hr = pComp->get_OperatingSystem(&bstr);
if(FAILED(hr)) {goto Cleanup;}
printf("Operating System: %S\n",bstr);
SysFreeString(bstr);
Cleanup:
if(pComp) pComp->Release();
if(bstr) SysFreeString(bstr);
return hr;
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows Vista |
Minimum supported server |
Windows Server 2008 |
Header |
|
DLL |
|
IID |
IID_IADsComputer is defined as EFE3CC70-1D9F-11CF-B1F3-02608C9E7553 |