JSI Tip 7785. How do I modify Active Directory attributes for all members of an Organizational Unit in my domain?

Jerold Schulman

February 29, 2004

4 Min Read
ITPro Today logo in a gray background | ITPro Today

Using the Active Directory command-line tools, in a Windows 2000 domain, or Windows Server 2003 domain, I have scripted OUusers.bat to modify Active Directory user attributes for all members of an OU .

The syntax for using OUusers.bat is:

OUusers OU P1a P1b [P2a P2b ... Pna Pnb]

Where:

OU         is the OU name in your domain.Pna        is a DSMOD parameter, and is always preceeded by a -.Pnb        is the value of the Pna parameter that you wish to set.Example:To set all users in the "My OU" OU in your domain to have a company name of "My OU subsidiary, Your Company"and a Web page of "http://www.YourCompany.com/.htm":Ouusers "My OU" -company "My OU subsidiary, Your Company" -webpg "http://www.YourCompany.com/$username$.htm"I have removed the detail description of the parameters that would not make sense to setfrom the following dsmod user /? display:Description:  Modifies an existing user in the directory.Syntax:     dsmod user  [-upn ] [-fn ]            [-mi ] [-ln ] [-display ]            [-empid ] [-pwd { | *}]            [-desc ] [-office ] [-tel ]            [-email ] [-hometel ] [-pager ]            [-mobile ] [-fax ] [-iptel ]            [-webpg ] [-title 
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like