Windows 服务器上次重启时间

96 windows

除了“网络统计服务器/工作站”之外,如何找到 Windows 服务器的上次重启时间?

Ben*_*oit 122

开始 -> 运行 -> cmd.exe

系统信息 | 找到“系统启动时间”

或者对于更新的操作系统版本(见评论):

系统信息 | 找到“系统启动时间”

  • 在 Windows XP 中工作,我假设 Windows Server 2003,但在 Windows 2008 上不起作用,因为它现在是“系统启动时间”。 (9认同)
  • 系统信息 | find /i "启动时间" (2认同)
  • 而且,这可以远程操作!systeminfo /s 服务器名 | ... (2认同)

小智 40

筛选事件 ID 6009 的系统事件日志。

  • 这特别好,因为如果您保留足够大的事件日志,您将拥有许多以前重新启动的历史记录。 (4认同)

Mou*_*tte 16

打开powershell命令并运行它以查看您的所有历史记录......并且不需要用户界面:-)

get-eventlog System | where-object {$_.EventID -eq "6005"} | sort -desc TimeGenerated
Run Code Online (Sandbox Code Playgroud)


小智 11

我使用Microsoft 的 Sysinternals 包中的PsInfo实用程序,它将为您提供如下输出:

PsInfo v1.77 - Local and remote system information viewer
Copyright (C) 2001-2009 Mark Russinovich
Sysinternals - www.sysinternals.com

System information for \\JEFF-DELL:
Uptime:                    0 days 0 hours 33 minutes 27 seconds
Kernel version:            Microsoft Windows XP, Multiprocessor Free
Product type:              Professional
Product version:           5.1
Service pack:              3
Kernel build number:       2600
Registered organization:
Registered owner:          
IE version:                8.0000
System root:               C:\WINDOWS
Processors:                2
Processor speed:           2.3 GHz
Processor type:            Intel(R) Core(TM)2 Duo CPU     E6550  @
Physical memory:           3316 MB
Video driver:              Live Mesh Remote Desktop Mirror Driver
Run Code Online (Sandbox Code Playgroud)

  • `psinfo uptime` 将只显示正常运行时间。 (4认同)

Sei*_*hun 10

如果您使用的是 Server 2008,您可以在“任务管理器”-“性能”选项卡上查看以小时为单位的系统正常运行时间。据我所知,“net statistics ...”方式是 Windows 2003 上唯一正确的方式。


小智 8

使用 wmi 客户端。

C:\>wmic OS GET CSName,LastBootUpTime
CSName    LastBootUpTime 
SERVER  20101124084714.500000-360
Run Code Online (Sandbox Code Playgroud)

注意:-360 = GMT-6


Col*_*337 6

上次系统启动时间

我个人最喜欢使用 WMI 和 Win32_OperatingSystem 属性/方法。这是一个简单的复制/粘贴单行:

((Get-WmiObject Win32_OperatingSystem).ConvertToDateTime((Get-WmiObject Win32_OperatingSystem).LastBootUpTime))
Run Code Online (Sandbox Code Playgroud)

同样的事情,但更容易手动输入:

$obj = Get-WmiObject Win32_OperatingSystem
$obj.ConvertToDateTime($obj.LastBootUpTime)
Run Code Online (Sandbox Code Playgroud)

这两个选项都提供如下输出:

Monday, June 30, 2014 11:59:50 AM
Run Code Online (Sandbox Code Playgroud)

系统正常运行时间

如果您想了解系统在线的时间,您可以这样做(这也是另一种代码风格):

$Obj = Get-WmiObject -Class Win32_OperatingSystem
$Obj.ConvertToDateTime($Obj.LocalDateTime) - $Obj.ConvertToDateTime($Obj.LastBootUpTime)
Run Code Online (Sandbox Code Playgroud)

这给出了如下输出:

Days              : 7
Hours             : 1
Minutes           : 59
Seconds           : 42
Milliseconds      : 745
Ticks             : 6119827457690
TotalDays         : 7.08313363158565
TotalHours        : 169.995207158056
TotalMinutes      : 10199.7124294833
TotalSeconds      : 611982.745769
TotalMilliseconds : 611982745.769
Run Code Online (Sandbox Code Playgroud)


小智 5

使用 Powershell

Get-CimInstance -ClassName win32_operatingsystem | select csname, lastbootuptime

CSName LastBootUpTime
Server 7/5/2014 6:00:00 AM
Run Code Online (Sandbox Code Playgroud)