[code]
strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\directory\LDAP") Set colItems = objWMIService.ExecQuery("SELECT * FROM ds_user",,48) For Each objItem in colItems Wscript.Echo "-----------------------------------" Wscript.Echo "ds_user instance" Wscript.Echo "-----------------------------------" 'Wscript.Echo "DS_objectGUID: " & objItem.DS_objectGUID 'Wscript.Echo "DS_objectSid: " & objItem.DS_objectSid Wscript.Echo "DS_pwdLastSet: " & objItem.DS_pwdLastSet Wscript.Echo "DS_sAMAccountName: " & objItem.DS_sAMAccountName Wscript.Echo "DS_sAMAccountType: " & objItem.DS_sAMAccountType Wscript.Echo "DS_whenCreated: " & objItem.DS_whenCreated Wscript.Echo "DS_whenChanged: " & objItem.DS_whenChanged Next
[/code]
Note that I commented out the GUID and SID properties. That was for simplicity. You can fetch them to a variable, convert them to an appropriate data type, so that WSH / VBScript can correctly "echo" the results. Cheers!
No comments:
Post a Comment