Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

IIS Information from Network Servers

$
0
0

I have the following script but am having issues exporting the information to a file with the Server name and if IIS is installed.  Any help?  This displays on screen currently.

$servers = (Get-Content c:\temp\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"}
}


Viewing all articles
Browse latest Browse all 6937

Trending Articles