PDA

View Full Version : How to add users into a group



guyver_news
12-10-2001, 03:20 PM
Dear all,

I have a lot of users that I want to add into a group and adding them manually is a very tedious task, using a vbscript or otherwise, can you supply me with the code to do so.

I am using Windows 2000 and have a ready CSV file with the NT usernames.

Thanks

Paul Thompson

darkness
12-14-2001, 02:02 PM
OK I will try this a second time.

set oGroup = getobject("LDAP://cn=Mygroup,ou=MyOrgunit,dc=Mydomain,dc=Com")
myuser = "LDAP://cn=myuser,ou=users,dc=Mydomain,dc=Com"
'Now I have bound to the group oject, and also have the user I wish to add
oGroup.add myuser
oGroup.setinfo
'Commit the changes made from the cache to the4 object

This will add a user to a group, stick that in a for loop while sucking in your csv file and BAM! your done.

Michael McLaughlin/images/forums/icons/smile.gif
Systems Manager
Minnesota State University Mankato

guyver_news
12-14-2001, 11:25 PM
Thank you again!