How can I disable a whole group of users?
March 4, 1999
A. There is no built in mechanism to do this but can be accomplished with 2 commands:
The first command users the resource kit utility SHOWMBRS.EXE outputing to a file:
C:>showmbrs > users.txt
e.g. C:>showmbrs savilltechsales > users.txt
The second command iterates through the file and performs a net user /active:no /domain
C:>for /f "skip=2" %I in (users.txt) do net user %I /active:no /domain
An example output is as follows
Click here to view image
If you wanted to create a script enter the following into file dsblgrp.bat. The usage is
dsblgrp
e.g. dsblgrp savilltechsales
REM
REM dsblgrp
REM by John Savill, 20th July 1998
REM
showmbrs %1 > users.txt
for /f "skip=2" %%I in (users.txt) do net user %%I /active:no /domain
Make sure you use two %% before the I or it won't work.
There is a problem with showmbrs.exe that only view groups with less than 7 members. To fix this download the fixed version from ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/Shombrs.exe
About the Author
You May Also Like