Set objGroup = GetObject _
("LDAP://CN=Finance Department,OU=Finance,DC=fabrikam,DC=com")
For Each strUser in objGroup.Member
Set objMember = GetObject("LDAP://" & strUser)
If objMember.Class <> "group" Then
objGroup.Remove(objMember.ADsPath)
End If
Next
Set objGroup = GetObject _
("LDAP://cn=Finance Managers, ou=Finance, dc=fabrikam, dc=com")
For Each strUser on objGroup.Member
Set objMember = GetObject("LDAP://" & strUser)
Wscript.Echo objMember.CN & ", " & objMember.Class
Next
Set objGroup = GetObject _
("LDAP://cn=Finance Managers, ou=Finance, dc=Fabrikam, dc=com")
Select Case objGroup.GroupType
Case 2
Wscript.Echo "This is a global distribution group."
Case 4
Wscript.Echo "This is a domain local distribution group."
Case 8
Wscript.Echo "This is a universal distribution group."
Case -2147483646
Wscript.Echo "This is a global security group."
Case -2147483644
Wscript.Echo "This is a domain local security group."
Case -2147483640
Wscript.Echo "This is a universal security group."
End Select
No comments:
Post a Comment