Introduction - Listing the members of the Users container
This script enumerates all the Administrators in the Builin container.
If you like to learn by changing items in the code, well here is a challenge for you,
adapt my script to list members of your OU.
WSH Topics
- Copy the entire Script in the green box below.
- Paste it into notepad.exe.
- File (menu), Save as AdminList.vbs. Note: This is where people go
wrong, remember the .vbs extension.
- Double click AdminList.vbs
'Script to List all the Administrators
in the Builtin container
'Script created by Guy Thomas
'Feel free to adapt names
Set objGroup = GetObject _
("LDAP://cn=Administrators, cn=Builtin, dc=CP,dc=com")
For each objMember in objGroup.Members
Wscript.Echo objMember.Name
Next
- Alter the cn=Administrators to the name of another group.
Note it must be the name of a real group.
- Alter the cn=Builtin to OU=yourou. Note you use OU here not
cn.
Its an organization unit not a container.
If you get an error message -
check this page
|
|