How can I disable a whole group of users?

John Savill

March 4, 1999

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

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

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