Sort Multidimention array
hello,
i need help. need collect domain servers “last boot time” , working following code.
i able collect information follows: “sequence number”, “server name” , “boot time”
now sort on “boot time”. advice appreciated.
$srvname = get-qadcomputer -sizelimit 0 -osname "*windows server*" | foreach {$_.name}
$srvname.count
$i = 0
$srvdata = $null
$srvname | foreach {
if (test-connection -count 1 -computer $_) {
$bootdate = get-wmiobject win32_operatingsystem -computername $_ | select lastbootuptime
$srvdata += @($i; $_; $bootdate.lastbootuptime)
$i++
}
}
learning powershell scripting
learning powershell scripting
Windows Server > Windows PowerShell
Comments
Post a Comment