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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with AD script

Status
Not open for further replies.

rlee111

Technical User
Sep 10, 2001
27
GB
Hi how would I add users to a group based on met criteria e.g. Department

I have the groups and users already created via a script, all users and groups are in the Users container in AD

Thanks for any help

Rob
 
I was thinking of putting the department info in the description property of the users, this would be the criteria I would check then based on that criteria add user to specific group, I have groups set up using department names e.g. Marketing, IT, Finance
 
Here's a link and a code snipit that may help you.

gl :) -Andrew


Code:
	Dim SystemInfo, objUser
	Set SystemInfo = CreateObject("ADSystemInfo")
	Set objUser = GetObject("LDAP://" & SystemInfo.Username)
	msgbox objUser.department

alien.gif

[Signature modified by admin request]
-TAG
anongod@hotmail.com
'Drawing on my fine command of language, I said nothing.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top