Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Results logging with add user scripting

Status
Not open for further replies.

Currivan

MIS
May 12, 2004
25
US
I am using *.cmd scripts to add multiple users to an OU on the domain. In order to keep track of the results, I have added code to each line to redirect the output to a log file using the append operator such as follows:

dsadd user {parameters} >> filename.log

However, the system only reports the successes and not the failures - which I am more concerned about, obviously. Your help is greatly appreciated.
 
This time, I get to answer my own question thanks to O'Reilly's Windows 2000 Command Reference Guide. It's actually quite simple, and the modified code is as follows:

dsadd user {parameters} >> filename.log 2>&1

You can find more parameters for the append operator, such as error only, in this handy guide.

Cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top