List Servers Running IIS

import-module activedirectory $servers=Get-ADComputer -Filter {operatingsystem -Like “Windows server*”} | select -ExpandProperty Name $servers | Out-File “<Change path to>\Servers.txt” -append default $serversall = (Get-Content “<Change path to>\Servers.txt”) Start-Transcript -path “<Change path to>\output.txt” -append default foreach($vm in $serversall) { $iis = get-wmiobject […]

Windows Server List Features in Powershell

$domain= ”YOURDOMAIN”$pass=ConvertTo-SecureString -String ‘YOURPASS’ -AsPlainText -Force$creds=New-Object System.Management.Automation.pscredential -ArgumentList $domain, $pass (Get-Content c:\server_list.txt| Foreach{Invoke-Command -ComputerName $_ -Verbose -ScriptBlock{get-windowsfeature |Where-Object{$_.installed -eq $true -and $_.featuretype -eq ‘Role’} |select name, installed -ExcludeProperty subfeatures} -Credential $creds}) | `Format-Table -Property Name, Installed, @{name=’Server Name’;expression={$_.pscomputername}} -AutoSize