Hi,
I need to check if IIS is running in a remote server. This is what I have collected from web, but not working. Even though IIS is running in the remote-server, but this check always saying "Not running".
---------------------------------
$servers = @("STGNX150-1")
foreach($server in $servers)
{
$iis = get-wmiobject Win32_Service -ComputerName $server -Filter "name='IISADMIN'"
if($iis.State -eq "Running")
{Write-Host "IIS is running on $server"}
else
{Write-Host "IIS is not running on $server"}
}
---------------------------------
I need to check if IIS is running in a remote server. This is what I have collected from web, but not working. Even though IIS is running in the remote-server, but this check always saying "Not running".
---------------------------------
$servers = @("STGNX150-1")
foreach($server in $servers)
{
$iis = get-wmiobject Win32_Service -ComputerName $server -Filter "name='IISADMIN'"
if($iis.State -eq "Running")
{Write-Host "IIS is running on $server"}
else
{Write-Host "IIS is not running on $server"}
}
---------------------------------