Link to home
Start Free TrialLog in
Avatar of Billetkontoret
Billetkontoret

asked on

Script to update "Street" on users in AD

Hi guys.

We are switching to a new address and I therefore want to update the "Street" field on my users in AD. I don't want to do this by hand but with a script.

Can you please help me with this? I have no experience with vbs.

I want to update all users in the ou:Employees,ou:DK,ou:test. And the new value for "Street" should be "teststreet".

Thank you all.
Avatar of Premkumar Yogeswaran
Premkumar Yogeswaran
Flag of India image

HI

Check this to modify the street

dsquery user ou=Employees,ou=DK,ou=test,dc=india,dc=com -limit 0 | dsmod user -street test street

Let me know if you have any issue

Cheers,
Prem
dsquery user ou=Employees,ou=DK,ou=test,dc=india,dc=com -limit 0 | dsmod user -street test street

Open in new window

Copy paste the query which i posted above in command prompt

cheers,
Prem
Avatar of Billetkontoret
Billetkontoret

ASKER

Thank you.

I get this error:

dsmod failed:`-street' is an unknown parameter.

I am running it on my Win 2003 DC.
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
This is a screenshot of the tool in action.
1.jpg
HI,

You can do the same with the saved queries.

create a saved queiries in ADUC by following the link below

http://www.windowsecurity.com/articles/Using-Saved-Queries.html

@ Query Root point the OU

@ Define Query -> Common queries -> User tab -> Name start with *

click ok

so it will display all the users in that OU

Select all users go to address tab and update the street

Let me know if you any issue

the link above will guide u step by step

Also refer:

http://www.petri.co.il/saved_queries_in_windows_2003_dsa.htm

Good Luck

Cheers,
Prem
This is a great tool!