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.
September 29, 2003
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
You May Also Like