If you don't have
Showmbrs from the resource kit, use
GroupList.bat. The syntax is:
GroupList GroupName OutputFileName
GroupList.bat contains:
@echo off setlocal if \{%1\}NOTE: To enumerate a local group, create LocalGroupList.bat, replacing:\{\} goto syntax if \{%2\}
\{\} goto syntax set grp=%1 set file=%2 if exist %file% del /q %file% for /f "Skip=8 Tokens=*" %%i in ('net group %grp% /domain') do set line=%%i&call :parse endlocal goto :EOF :syntax @echo Syntax GroupList GroupName OutputFileName endlocal goto :EOF :strip set short=%name%# set short=%short: =% set short=%short: #=#% set short=%short:#=% @echo %short%>>%file% goto :EOF :parse set name=%line:~0,25% If /i "%name%" EQU "The command completed suc" goto :EOF call :strip set name=%line:~25,25% if not "%name%" EQU "" call :strip set name=%line:~50,25% if not "%name%" EQU "" call :strip
('net group %grp% /domain')
with
('net localgroup %grp%')
0 comments
Hide comments