How to disable specific users via command ?

Solved/Closed
kelnasawa Posts 20 Registration date Thursday January 23, 2014 Status Member Last seen October 10, 2014 - Mar 24, 2014 at 05:42 AM
 kelnasawa - Mar 28, 2014 at 04:50 AM
hello guys .... is there a way to select a number of AD users and disable them ... then at a later time enable them ?
the scenario is ... i work in a university and during the exams i create new users for them and i disable their normal users so they dont access their home folder but it frustrating searching for every user by itself disabling it ...
so if theres a way via command or vb script id be thankful ...
i work on WS 2003 .
thank you
Related:

4 responses

Blocked Profile
Mar 24, 2014 at 08:04 AM
hello,

here is the command:

Using a command line

Open Command Prompt.

Type:

dsmod userUserDN-disabled {yes|no}


See here for more info: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc781527(v=ws.10)?redirectedfrom=MSDN#BKMK_cmd
1
kelnasawa Posts 20 Registration date Thursday January 23, 2014 Status Member Last seen October 10, 2014
Mar 26, 2014 at 02:15 AM
hey , thanks
i also did it in an easier way ..
" net user USERNAME /active:no " and i added all users in a .bat file

regards
0
Blocked Profile
Mar 26, 2014 at 06:50 AM
I assume you have to specify the domain name somewhere?

Otherwise net user USERNAME would look for the local users.
0
hello ... well
net user USERNAME /active:no
is working perfectly no need for adding domain name or anything ... maybe coz im running it from the DC itself ...
0