Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Active directory members

Status
Not open for further replies.

matty1404

MIS
Feb 12, 2007
74
US
I am copy and pasting script from the portable script center. I dont know which stuff I need to put in and which stuff is suppose to stay there. Anyone help??


On Error Resume Next

Set objGroup = GetObject _
("LDAP://cn=Scentists,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
 
What part of this script is giving you issues? You should be able to run it by providing the proper distinguished name for your environment. i.e cn=xxx,ou=xxx,dc=domain,dc=com

You can find more examples here:
--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
What do the X's and the com mean exactly. Like what does cn, ou, and dc stand for?
 
This represents the root DN of your search.

("LDAP://cn=Scentists,ou=R&D,dc=NA,dc=fabrikam,dc=com")

In this case you would be searching an OU called Scientists which is inside of another OU called R&D. The domain in this example is called fabrikam.com.

What you are seeing is a distinguished name.
 
You can query using some of the examples in the link I provided for the distinguished name. You can also use ADSI edit that comes with Win2k3 support tools to view a user/group object and see their distinguished name.

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top