Question : Script to determine uptime for multiple servers

I have a mixed Windows 2000, Windows 2003 x86 and Windows 2003 x64. I'd like a script that will take a list of server names from a text file, and determine the uptime for each server. I found a script that seemed to work for 32 bit only. The script is attached.

Thank you,
Dan
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
$Servers = Get-Content Servers.txt 
 
foreach($Server in $Servers) 
 
{ 
 
$wmi=Get-WmiObject -class Win32_OperatingSystem -computer $server
 
$LBTime=$wmi.ConvertToDateTime($wmi.Lastbootuptime)
 
[TimeSpan]$uptime=New-TimeSpan $LBTime $(get-date)
 
Write-host $server Uptime:  $uptime.days Days $uptime.hours Hours $uptime.minutes Minutes $uptime.seconds Seconds
 
}
Open in New Window Select All

Answer : Script to determine uptime for multiple servers

I have a cool script that does this located here: http://bsonposh.com/archives/215

I have tested this against x64 and it works find. What error do you get?
Random Solutions  
 
programming4us programming4us