JSI Tip 7262. How many users exist in your domain?

Jerold Schulman

September 29, 2003

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

If you need to count the number of users in your domain, run NumberOfUsers.bat from your workstation.

NumberOfUsers.bat contains:

@echo offsetlocalset /a numb=0for /f "Skip=4 Tokens=*" %%i in ('net user /domain^|findstr /v /c:"----"^|findstr /v /i /c:"The command completed"') do ( set line=%%i call :parse)@echo Number of users=%numb%endlocalgoto :EOF:parseset name=%line:~0,25%set /a numb=%numb% + 1set name=%line:~25,25%if not "%name%" EQU "" set /a numb=%numb% + 1set name=%line:~50,25%if not "%name%" EQU "" set /a numb=%numb% + 1



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