G
Guest
I have used the following script which can be found here -
http://www.microsoft.com/technet/scriptcenter/scripts/ad/groups/adgpvb13.mspx
- for listing all the members of a group:
On Error Resume Next
Set objGroup = GetObject _
("LDAP://cn=Scientists,ou=R&D,dc=NA,dc=fabrikam,dc=com")
objGroup.GetInfo
arrMemberOf = objGroup.GetEx("member")
WScript.Echo "Members:"
For Each strMember in arrMemberOf
WScript.echo strMember
Next
This works well but I need to display the sAMAccountName for the members of
the group but this isn't available within the group information.
Any ideas? If this isn't the best way (LDAP) and I should be using ADSI
could someone please provide me with a sample script?
Thanks.
http://www.microsoft.com/technet/scriptcenter/scripts/ad/groups/adgpvb13.mspx
- for listing all the members of a group:
On Error Resume Next
Set objGroup = GetObject _
("LDAP://cn=Scientists,ou=R&D,dc=NA,dc=fabrikam,dc=com")
objGroup.GetInfo
arrMemberOf = objGroup.GetEx("member")
WScript.Echo "Members:"
For Each strMember in arrMemberOf
WScript.echo strMember
Next
This works well but I need to display the sAMAccountName for the members of
the group but this isn't available within the group information.
Any ideas? If this isn't the best way (LDAP) and I should be using ADSI
could someone please provide me with a sample script?
Thanks.