Computer Information

List Computer properties as displayed in ADUC

'compinfo.vbs

' Usage:
'        cscript //Nologo compinfo.vbs

' List Computer properties as displayed in ADUC

On Error Resume Next
Dim objSysInfo, objComp
Set objSysInfo = CreateObject("ADSystemInfo")

' Current computer
Set objComp = GetObject("LDAP://" & objSysInfo.ComputerName)
 ' or a specific computer:
 ' Set objComp = GetObject("LDAP://CN=pc005,OU=Computers,DC=ss64,DC=com")

WScript.Echo "--- Computer Properties ---"
WScript.Echo "Name: " & objComp.name
WScript.Echo "cn: " & objComp.cn
WScript.Echo "DNSHostName: " & objComp.dNSHostName

WScript.Echo "OperatingSystem: " & objComp.operatingSystem
WScript.Echo "ServicePack: " & objComp.operatingSystemServicePack

WScript.Echo "SAMAccountName: " & objComp.sAMAccountName
WScript.Echo "Location: " & objComp.location
WScript.Echo "UserAccountControl: " & objComp.userAccountControl
WScript.Echo "PrimaryGroupID: " & objComp.primaryGroupID
WScript.Echo "WhenCreated: " & objComp.whenCreated
WScript.Echo "WhenChanged: " & objComp.whenChanged
WScript.Echo "DistinguishedName: " & objComp.distinguishedName

“Success is falling nine times and getting up ten” ~ Jon Bon Jovi

Related:

ListComputers.vbs - List all computers
userinfo.vbs - List properties of a User (as shown in ADUC)
SearchAD - Search AD for either Users, Computers or groups
Powershell : Get-adComputer


© Copyright SS64.com 1999-2014
Some rights reserved