- Joined
- Jul 23, 2009
- Messages
- 2
- Reaction score
- 0
Hi All,
I need to create a batch file or script to find users with specific attribute & add them to a group. I need this script to run on schedule task so that my security group is updated. we have specified this attribute to all users whenever there is any new joiner in our organization.
we have created a custom attribute in AD "extensionattribute3" to specify the user team vertical. we have around 15 such verticals. I need to find users with specific vertical & add them to a security group.
I can extract the list of users with specific attribute & dump the file on local machine but I’m not able to find the solution to add them to group.
This is the script which I’m using as of now
dsquery * -filter "(&(&(objectcategory=person)(objectclass=user))(|(extensionattribute3=Abc.sales)))" -attr sAMAccountName extensionAttribute3 -limit 0 >c:\abc.txt
I need to create a batch file or script to find users with specific attribute & add them to a group. I need this script to run on schedule task so that my security group is updated. we have specified this attribute to all users whenever there is any new joiner in our organization.
we have created a custom attribute in AD "extensionattribute3" to specify the user team vertical. we have around 15 such verticals. I need to find users with specific vertical & add them to a security group.
I can extract the list of users with specific attribute & dump the file on local machine but I’m not able to find the solution to add them to group.
This is the script which I’m using as of now
dsquery * -filter "(&(&(objectcategory=person)(objectclass=user))(|(extensionattribute3=Abc.sales)))" -attr sAMAccountName extensionAttribute3 -limit 0 >c:\abc.txt