I always forget the correct line for listing these things with WMI.
Therefore, it’s now perpetuated on Fuffle.net. =)

cls
$servers = get-content "C:tempserverlist.txt"
foreach ($s in $servers){
$gwmi = (Get-WmiObject -ComputerName $s -class win32_operatingsystem -ErrorAction SilentlyContinue).caption
    write-host "$s - IP:"([System.Net.Dns]::GetHostAddresses($s)) - $gwmi  -foregroundcolor “green"}

-F

Leave a Reply