Link to home
Start Free TrialLog in
Avatar of Bryon H
Bryon HFlag for United States of America

asked on

dsquery / dsmod active directory users

here's an easy 500 points for someone

i have about 200 users i need to modify the active directory attribute called "web page" from one thing to another.

many of these users need to have a completely unrelated site in there, and not changed, and are not part of specific OU's or groups

can i use any AD command-line things, that can say something like:
"look at all users, if their 'web page' is http://www.foo.com, change it to http://www.bar.com"  ?

for clarification:
200 users in "users" OU
180 of them need to change from foo to bar (as above)
20 of them need to stay exactly as they are and not change at all
Avatar of ClintSwiney
ClintSwiney

This may be oversimplifying it but... What if you moved the 20 users to a different OU temporarily, Made the change to the remaining 180, them move the 20 back in?

Avatar of Bryon H

ASKER

i could do that - but i dont really know who they are... i know their "web page" attribute is different though...  they might have www.blah.com, and shouldnt be changed

if i wanted to just run it across all users anyway, and see who complains, what would that command be?
ASKER CERTIFIED SOLUTION
Avatar of Joseph Daly
Joseph Daly
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'll test dsquery/mod but I like using adfind and admod too

http://www.joeware.net/freetools/tools/adfind/index.htm
http://www.joeware.net/freetools/tools/admod/index.htm

adfind -b "DN of your OU"  -f "&(objectcategory=person)(objectclass=user)(wwwhomepage=http://www.foo.com)" -adcsv | admod "wwwhomepage::http://www.bar.com"

...and for those that may come across this question via bing/google there is also a free GUI tool that is good and that is admodify.net  http://admodify.codeplex.com/

in this case you could use the LDAP query to find the users.

Thanks

Mike
....looks like I won't have to test dsquery/dsmod,  thanks xxd
The only addition I could make to mine that you had in your ADfind example would be to optionally target an OU. Right now mine is looking everywhere for users with the webpage set.
Avatar of Bryon H

ASKER

this worked almost perfectly, just had to add -limit 300 into it, it only wanted to do 100.

so the complete command was:

dsquery * -limit 300 -filter "(&(objectCategory=user)(wWWHomePage=www.testing.com*))"  | dsmod user -webpg www.bar.com