CntdwnToExtn
Fully Optimized
- Messages
- 1,746
- Location
- Parents Basement...Still
i have this script to display what groups each "user" belongs to in a specific OU
which successfully finds all the users in the "Users" OU
however, i want it to find users in a different OU
i specifiy
however the results turn up blank when i know there are users.
am i missing something here?
not all that familiar with VBS.
thanks
Code:
On Error Resume Next
Const E_ADS_PROPERTY_NOT_FOUND = &h8000500D
Set objOU = GetObject _
("LDAP://cn=users,dc=MyDomain,dc=com")
ObjOU.Filter = Array("user")
For Each objUser in objOU
WScript.Echo objUser.cn & " is a member of: "
WScript.Echo vbTab & "Primary Group ID: " & _
objUser.Get("primaryGroupID")
arrMemberOf = objUser.GetEx("memberOf")
If Err.Number <> E_ADS_PROPERTY_NOT_FOUND Then
For Each Group in arrMemberOf
WScript.Echo vbTab & Group
Next
Else
WScript.Echo vbTab & "memberOf attribute is not set"
Err.Clear
End If
Wscript.Echo
Next
which successfully finds all the users in the "Users" OU
however, i want it to find users in a different OU
i specifiy
Code:
Set objOU = GetObject _
("LDAP://cn=Different OU,dc=MyDomain,dc=com")
however the results turn up blank when i know there are users.
am i missing something here?
not all that familiar with VBS.
thanks