This is a quick script that will tell you if IIS is running on a list of remote servers. Just like my other scripts this one requires a “servers.txt” file in the same location as the script. I enter all the servers I want to check in that file.
$servers = (Get-Content servers.txt) foreach($vm in $servers){ $iis = get-wmiobject Win32_Service -ComputerName $vm -Filter "name='IISADMIN'" if($iis.State -eq "Running") {Write-Host "IIS is running on $vm"} else {Write-Host "IIS is not running on $vm"} }
Awesome! Very handy
any idea how to check IIS version?
You can get the IIS version from the registry: HKLM:\SOFTWARE\Microsoft\InetStp\VersionString. From powershell: get-itemproperty HKLM:\SOFTWARE\Microsoft\InetStp\ | Select VersionString
Please provide us the step by step instruction to run this script
Woohoo! Thanks for this 🙂
how to verify if website exists on remote machine
Which version of powershell? Powershell v3 has a whole new IIS module in it which makes this an easy task.
This is really awsome!!! Thanks much
Hello Brian,
This script works like a gem.
Wondering if we can add a script to this to also list the application pools by and their status on remote servers ?
Thank you
Your script might not work well on server 2012 IIS machines. I changed it to key off the service “name=’W3SVC'”
Maybe query W3SVC here instead of IISAdmin as it may or may not be installed!