Skip to content

Instantly share code, notes, and snippets.

@caquino
Created May 27, 2013 20:53
Show Gist options
  • Save caquino/5659030 to your computer and use it in GitHub Desktop.
Save caquino/5659030 to your computer and use it in GitHub Desktop.
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
FOR %%A IN (%*) DO (
PSEXEC.EXE \\%%A %windir%\system32\inetsrv\appcmd list requests > %TMP%\output-%%A.log 2>&1
)
FOR %%A IN (%*) DO (
TYPE %TMP%\output-%%A.log | FIND "REQUEST" >> %TMP%\output.log
DEL %TMP%\output-%%A.log
)
FOR /F "tokens=2,3 delims==:" %%A IN (%TMP%\output.log) DO ECHO %%A | SORT >> %TMP%\outputs.log
FOR /F "tokens=1,2 delims==," %%A IN (%TMP%\outputs.log) DO ECHO %%A | SORT >> %TMP%\outputc.log
FOR /F "tokens=1,2 delims==?" %%A IN (%TMP%\outputc.log) DO ECHO %%A | SORT >> %TMP%\outputq.log
FOR /F "tokens=1,2 delims==?" %%A IN (%TMP%\outputq.log) DO (
IF DEFINED ELEMS["%%A"] (
SET C=!ELEMS["%%A"]!
SET /A C+=1
SET ELEMS["%%A"]=!C!
) ELSE (
SET ELEMS["%%A"]=1
)
)
FOR /F "tokens=1,2 delims==?" %%A IN (%TMP%\outputq.log) DO (
IF !ELEMS["%%A"]! GTR 0 (
ECHO !ELEMS["%%A"]! %%A >> %TMP%\result.log
SET ELEMS["%%A"]=0
)
)
TYPE %TMP%\result.log | SORT /+1 /R | MORE
ENDLOCAL
DEL %TMP%\output.log
DEL %TMP%\output?.log
DEL %TMP%\result.log
@jpillcos
Copy link

jpillcos commented Sep 8, 2022

Me puede ayudar como ejecutar el script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment