How To Check Server Uptime Windows 2012
Windows uptime is a measurement that many server administrators utilise to troubleshoot 24-hour interval-to-day issues that may arise in the environment. In this article, you're going to learn how to check boot time in Windows x and Windows Server. You're free to utilize whichever style is easiest for you lot. Use this article every bit a future reference.
The article volition be broken up into two main parts; checking server uptime and finding historical Windows uptime. The first office volition focus on finding how much fourth dimension the computer has been upward since its last reboot. This is called "current" uptime in this article.
The second part of the article will focus on finding "historical" uptime significant a reboot on how long a Windows organization was upwards between multiple reboots. Using PowerShell, you lot'll learn how to parse the Windows event log to pull historical uptime numbers.
How to Cheque Boot Time in Windows 10 and Windows Server
To get started, allow's at present spring into a few dissimilar means to detect the electric current Windows uptime.
Yous'll be seeing a sit-in of how to check kick time in Windows 10 past running commands locally on a Windows system through this section. Only know that past using PowerShell Remoting, you can also perform these checks remotely (excluding task managing director).
Chore Manager
One of the most simple and straightforward ways to find uptime is to merely open Task Manager.
To check Windows uptime with Task Manager, correct-click the Windows taskbar and select Task Director or press Ctrl–Shift–Esc. Once Task Manager is open, click on the Performance tab. Nether the Performance tab, you will encounter a label of Upward Time.

Effect Viewer
Result Viewer is very normally used by most sysadmins on a regular ground, which makes information technology a great option for a non-control line-related method of retrieving uptime. Event ID 6005 and 6006 tin be used to identify when the issue log service starts or stops, which occurs during boot/shut downtimes. Follow these steps to identify uptime via Effect Viewer:
- Bring upward the Offset Menu and simply search for Event Viewer, y'all can also go to it via Computer Direction.
- On the left, expand the Windows Logs department and select Organization
- Now that we are querying only System related events, click "Filter Current Log…" on the right hand side of your window
- In the Consequence ID field (by default this volition exist prefilled with text stating "All Event IDs") nosotros need to search for our applicative Consequence IDs, type "6005, 6006" and so click OK
You lot can so compare the two times to create a total uptime. Likewise, since many instances of these events are stored, we can query the history of uptimes!
You now have filtered Event Logs that will show y'all not just the terminal fourth dimension just all known times in which there has been a bootup/shut down.
PowerShell
PowerShell has a few dissimilar means you can retrieve uptime. You can either query WMI or employ the Windows event log.
When querying WMI, you can query the Win32_OperatingSystem grade and select the LastBootUpTime
property as shown below.
PS51> Get-CimInstance Win32_OperatingSystem | Select-Object LastBootUpTime LastBootUpTime -------------- nine/25/2019 9:37:37 PM
To query the Event Log via PowerShell, utilize the Get-WinEvent
cmdlet. You lot'll need to search for upshot IDs 6005 or 6006 that indicate the terminal fourth dimension the machine was started.
PS51> Get-WinEvent -ProviderName EventLog | Where-Object {$_.Id -eq 6005 -or $_.Id -eq 6006} | Select-Object -First ane TimeCreated TimeCreated ----------- 9/25/2019 9:37:52 PM
WMIC
WMIC provides a command-line interface for WMI and is a tried and true method that has been used for many years. To query via uptime via WMIC y'all query the Win32_OperatingSystem WMI form again although a fleck under the covers. You can meet below y'all can utilize the WMIC syntax bone get lastbootuptime
to render the last time the server was started.
> wmic bone get lastbootuptime LastBootUpTime 20190925213737.500000-240
You do non have to download annihilation to leverage WMIC, as information technology comes pre-installed with Windows.
Organisation Information Utility
The systeminfo command displays detailed configuration info about a computer and tin be used to query system uptime. By using the built-in discover control line tool you can parse the text to retrieve the information you need.
Just open up either Command Prompt or PowerShell and blazon systeminfo | find
.
> systeminfo | observe "Arrangement Kick Time:" System Boot Fourth dimension: 9/25/2019, 9:37:37 PM
You do non have to download anything to leverage systeminfo
, as it comes pre-installed with Windows.
Net Statistics Control
You can also speedily query uptime via Cyberspace Statistics or more normally known as net stats
. The net stats
control returns general information about your session. You can see below the Statistics since… line. This date indicates when the motorcar was started.
> cyberspace stats srv Workstation Statistics for \\NATES-PC Statistics since nine/25/2019 9:37:52 PM --SNIP-- The command completed successfully.
Uptime Control
If you need a small, portable utility to discover Windows uptime, await no farther than NeoSmart Technologies' Uptime control for Windows. This utility is perfect for rapidly querying uptime on whatever Windows version. The major benefit of this tool is the convenience factor. If you find yourself using this many times per day you may want to consider this method.
After downloading the tool, extract uptime.exe to %WinDir%\System32. Then open up a command prompt and only type uptime
.

To run this tool remotely, yous'd first need to copy the tool to the Windows systems you're checking uptime on.
Introducing the Go-ServerUptimeReport script
And so you don't have to write the PowerShell yourself, download a customs script called Get-ServerUptimeReport.ps1.
PS51> Install-Script -Proper noun Go-ServerUptimeReport
This script allows y'all to provide a computer proper noun as a parameter. It will then parse the Arrangement upshot log of the computer and discover both a starting time and stop event to compare the two. Information technology volition then return the full time the server was online until the event log has rolled.
Below is an example of using this script on a server. It volition return the total uptime for all of the events the server has in the result log, including the electric current uptime.
PS51> ./Get-ServerUptimeReport.ps1 -ComputerName sqlsrv1 Startup Shutdown Uptime (Days) Uptime (Min) ------- -------- ------------- ------------ 9/16/2017 12:40:00 PM nine/22/2017 iv:20:xi PM vi.15 8860.18 9/16/2017 10:22:49 AM 9/xvi/2017 12:22:36 PM 0.08 119.79 9/16/2017 3:22:12 PM 9/22/2017 4:twenty:11 PM 6.04 8697.98
Finding Windows Uptime Across Many Servers
This script is a quick way to notice the uptime of a single server across many days. Only what if you need this data for lots of servers at in one case? To practise this, you tin can gather upward a list of servers and so pass each calculator name, one at a fourth dimension, to this script.
Every bit an example, ascertain all your servers in an assortment in the PowerShell console. In this example, the variable array volition exist called $servers
.
In reality, though, you might be pulling server names from Active Directory, Hyper-V, or a text file. As long as you can build an assortment of server names, you're fine.
Define all the server names and then iterate over each i with a loop, as shown below.
$servers = 'WEBSRV1','SQLSRV1' foreach ($server in $servers) { Get-ServerUptimeReport.ps1 -ComputerName $server } Startup Shutdown Uptime (Days) Uptime (Min) ------- -------- ------------- ------------ 9/16/2017 12:45:48 PM ix/22/2017 4:25:39 PM 6.15 8859.86 9/sixteen/2017 x:42:52 AM 9/sixteen/2017 12:42:34 PM 0.08 119.7 9/16/2017 2:42:17 PM nine/22/2017 4:25:39 PM 6.07 8743.38 9/16/2017 12:40:00 PM 9/22/2017 four:25:39 PM half dozen.16 8865.65 9/16/2017 10:22:49 AM 9/16/2017 12:22:36 PM 0.08 119.79 nine/16/2017 3:22:12 PM 9/22/2017 4:25:39 PM six.04 8703.46
This code works, but you tin't decide which server each row references. Add a server name to the output like below using a calculated property.
$servers = 'WEBSRV1','SQLSRV1' foreach ($server in $servers) { Go-ServerUptimeReport.ps1 -ComputerName $server | Select-Object -Property *,@{n='ServerName';e={$server}} } Startup Shutdown Uptime (Days) Uptime (Min) ServerName ------- -------- ------------- ------------ ---------- 9/xvi/2017 12:45:48 PM 9/22/2017 iv:34:59 PM half-dozen.xvi 8869.19 WEBSRV1 9/sixteen/2017 10:42:52 AM 9/16/2017 12:42:34 PM 0.08 119.vii WEBSRV1 ix/xvi/2017 2:42:17 PM 9/22/2017 4:34:59 PM 6.08 8752.71 WEBSRV1 Startup Shutdown Uptime (Days) Uptime (Min) ServerName ------- -------- ------------- ------------ ---------- nine/16/2017 12:40:00 PM 9/22/2017 4:35:01 PM 6.16 8875.01 SQLSRV1 ix/sixteen/2017 10:22:49 AM ix/16/2017 12:22:36 PM 0.08 119.79 SQLSRV1 nine/16/2017 3:22:12 PM 9/22/2017 4:35:01 PM 6.05 8712.81 SQLSRV1
We now have an fantabulous little tool that can provide us a quick report on uptime for our servers over time!
Summary
You've now seen many different means to notice Windows uptime. Regardless of which option y'all choose, you'll receive the aforementioned information. Choose the best one for your own context.
And remember if you lot need a historical report of uptime history, don't forget about the Get-ServerUptimeReport
PowerShell script!
Source: https://adamtheautomator.com/windows-uptime/
Posted by: robeyandeavy1951.blogspot.com
0 Response to "How To Check Server Uptime Windows 2012"
Post a Comment