El siguiente script se puede ejecutar en equipos Windows remotos y enumerará el contenido del grupo de administradores locales del servidor remoto.
Requiere Sysinternals PSExec utilidad y debe ejecutarse con credenciales administrativas. Establezca las cuatro rutas en las ubicaciones correctas para su estación de trabajo.
REM set path to PSexec on machine the script is being run from Set PSExecDir=c:pstools REM Set file that contains the list of all your remote machines Set InputFile=C:servers.txt REM Set path to file where administrator group membership is logged Set OutputFile=C:localadmins.txt REM set path to error log file Set ErrorFile=C:errors.txt for /f %%a in (%InputFile%) do ( echo *** Checking Server %%a *** >> %OutputFile% %PSExecDir%psexec \%%a net localgroup administrators >> %OutputFile% IF ERRORLEVEL 1 (echo Problem with obtaining local administrators on %%a >> %ErrorFile%) )