This scipt will get the list of computers you want to check, ping for availability, then produce a text file with your results. It also produces a file of computers that where not available. Disclosure: This is my 1st script.
function PING {
PROCESS {
$results = gwmi -query "SELECT StatusCode FROM Win32_PingStatus WHERE Address = '$_'"
foreach ($result in $results) {
if ($result.StatusCode -eq 0) {
write $_ >> c:\Ping.txt
}
else
{
write $_ >> c:\NoPing.txt
}
break
}
}
}
New-Item -type file c:\Ping.txt -Force
New-Item -type file c:\NoPing.txt -Force
$Ping = gc c:\computers.txt | PING
function BIOS {
Process {
foreach ($Asset in $Assets) {
$name = gwmi win32_computersystem -computerName $_
$Bios = gwmi win32_Bios -computerName $_
}
$a = $name.name
$b = $name.model
$c = $Bios.SMBIOSBIOSVersion
$computer = ("$a,$b,$c") >> c:\BiosVersion.txt
}
}
New-Item -type file c:\BiosVersion.txt -Force
$Result = gc C:\Ping.txt | BIOS |