Friday, March 27, 2009

How can i disable many users who login names in the file.txt.

Try following command line statement on Windows 2003 machine.
Following statement will read NTLogins,txt file and will disable all user whose names are listed.

Click Start -> Run -> Cmd.exe -> OK

FOR /F "delims=" %u IN ('TYPE NTLogins.txt') DO @DSQuery user -samID "%u" DSMod user -disabled Yes

No comments: