• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 636
  • Last Modified:

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
0
B H
Asked:
B H
  • 2
  • 2
  • 2
  • +1
1 Solution
 
ClintSwineyCommented:
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?

0
 
B HAuthor Commented:
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?
0
 
Joseph DalyCommented:
I got it for you right here.


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

You need to use an LDAP filter which will return all the users with a specific page and then change that.

Run this first to see what users you are GOING to change
dsquery * -filter "(&(objectCategory=user)(wWWHomePage=www.testing.com*))"

Then when your comfotable with that run the dsmod one
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Mike KlineCommented:
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
0
 
Mike KlineCommented:
....looks like I won't have to test dsquery/dsmod,  thanks xxd
0
 
Joseph DalyCommented:
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.
0
 
B HAuthor Commented:
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
0

Featured Post

Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now