|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Find last restart time
Hello,
Please help me to find the 'last system restart time' for a group of servers in Windows 2003 AD using VB script. At present we are using 'net statistics ' command to find the last restart time in each servers. Thanks. You can use WMI Win32_OperatingSystem class:
strComputer = "." Set objWMIService = GetObject("winmgmts:" & _ "{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\cimv2") Set colOS = objWMIService.ExecQuery _ ("SELECT * FROM Win32_OperatingSystem") For Each objOS in colOS WScript.Echo objOS.LastBootUpTime Next This gets the last bootup time for the local computer. I hope it gets you started. -- Show quoteurkec "George" wrote: > Hello, > > Please help me to find the 'last system restart time' for a group of servers > in Windows 2003 AD using VB script. At present we are using 'net statistics ' > command to find the last restart time in each servers. > > Thanks. |
|||||||||||||||||||||||