Advertisement
mikedopp

IIS_Status

Sep 2nd, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.69 KB | None | 0 0
  1. :: This gets the Status of all IIS services. It reads a list of servers from 'ServerList.txt' file.
  2. :: To work properly, this needs to be ran on the same LAN or External network!!!
  3. ::
  4. echo off
  5. cls
  6. echo ** This get the Status of IIS services from a list of servers **
  7. SetLocal EnableDelayedExpansion
  8. echo.
  9. FOR /F "Tokens=*" %%L IN (ServerList.txt) DO (
  10.    SET ServerName=
  11.    SET ServerName=%%L
  12. echo.
  13. :: Gets Status of all IIS services
  14. echo ** IIS Service Status for !ServerName! **
  15. IISRESET /STATUS !ServerName!
  16. echo.
  17. :: Pause command
  18. echo ** Waiting 5 seconds for !ServerName! **
  19. PING 127.0.0.1 -n 5 -w 5000 >NUL
  20. echo.
  21. )
  22. echo.
  23. echo ** Done Processing, check Status **
  24. Pause
  25. :end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement