$colComputers = get-content "c:\powershell\outputfiles\AccessPass.Txt"
foreach ($strComputer in $colComputers)
{
$iisAdminSVC = [System.ServiceProcess.ServiceController]::GetServices($strComputer) | where{$_.name -eq 'IISADMIN'}
switch ($iisAdminSVC.status)
{
"Running" {$InstallStatus = "Installed"}
"Stopped" {$InstallStatus = "Installed"}
"Paused" {$InstallStatus = "Installed"}
"Starting" {$InstallStatus = "Installed"}
"Stopping" {$InstallStatus = "Installed"}
"" {$InstallStatus = "NOT Installed"}
}
write-host $strComputer $InstallStatus
}
|