NOTE: See How can I retrieve Active Directory attributes of the logged on user, using standard commands?
See the following sample:
On Error Resume Next Dim objSysInfo, objUser Set objSysInfo = CreateObject("ADSystemInfo") Set objComp = GetObject("LDAP://" & objSysInfo.ComputerName) Wscript.Echo objComp.whenCreated Wscript.Echo objComp.whenChanged Wscript.Echo objComp.name Wscript.Echo objComp.userAccountControl Wscript.Echo objComp.primaryGroupID Wscript.Echo objComp.sAMAccountName Wscript.Echo objComp.location Wscript.Echo objComp.operatingSystem Wscript.Echo objComp.operatingSystemServicePack Wscript.Echo objComp.dNSHostName
0 comments
Hide comments