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

thank you. did trick.

learning powershell scripting



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

2008 Windows Deployment Server Properties Error

Can no longer user MS Update - Files required to use Microsoft Update are no longer registered

How do a find data in one file, search for it in another file and if not found, write a custom message to another file