In this guide, I’ll show you how to check the uptime of a Windows Server and Windows client computers.
Checking the Windows uptime will show you how long the server has been running since it was last rebooted. This comes in useful when troubleshooting a Windows server for performance or application issues.
Windows Server Uptime Command
In this example, I’ll use a simple Windows command to check the server uptime.
-
Open the command prompt:
Copy and paste the command below:
systeminfo | find “System Boot Time”
-
Check the system Boot Time:
The command will display the date of the last boot time.
Option#2 Windows Uptime GUI Tool
In this example, I’ll use the AD Pro Toolkit to check the update on all computers.
Step 1. Open the AD Pro Toolkit and click on Windows Uptime.
Step 2. Click “Run” to get the uptime on all servers and computers.
I don’t have many computers in my test environment but you can see how easy the toolkit makes it for generating a report on uptime and last boot.
You can also export the report to csv, xlsx, and PDF by clicking the export button.
Download Free Trial
How to Check Windows Server Uptime with PowerShell
This command will work on PowerShell 5.1 or later versions.
Open PowerShell and use the command below.
(get-date) – (gcim Win32_OperatingSystem).LastBootUpTime
This command will show you how long it has been since the last reboot. It will display the uptime in days, hours, minutes, and seconds.
Another Powershell command that can be used to get the server uptime is the get-uptime cmdlet. The get-uptime cmdlet requires PowerShell version 6 or later.
Unfortunately, the get-uptime cmdlet has no parameter for checking the uptime on remote computers, it only works locally. See method 2 for a quick and easy way to get the uptime on remote and multiple computers.
Check Windows Uptime using Task Manager
You can easily check the uptime on a Windows system by using the task manager.
- Right click the taskbar and select task manaager
- Click on the Performance tab
- The up time will be displayed under the CPU graph.
Check Windows Uptime with Net Statistics
In this last example, I’ll use the net statistics command. This command will show various network statistics but also keeps track of the uptime.
- Open the command prompt
- Enter the command -> net statistics workstation
- The uptime will be at the top
Summary
As an administrator of Windows systems, you will often need to check the uptime on servers and client computers. If you need to manually a single computer there a several command line options to easily see the uptime. If you need to generate a report on multiple or all systems then I would recommend using the uptime utility from the AD Pro Toolkit.
I hope this article helped you find the uptime on your Windows server or workstations. If you liked this article, then please subscribe to our YouTube Channel for more Active Directory tutorials.
Время непрерывной работы Windows с момента последней перезагрузки (uptime) можно узнать разными способами.
В графическом интерфейсе общее время работы Windows можно найти в диспетчере задач.
- Запустите Task Manager (выполните команды
taskmgr.exe
или нажмите сочетание клавиш
Ctrl+Shift+Esc
) - Перейдите на вкладку Производительность (Performance) -> вкладка ЦП (CPU)
- Время непрерывной работы компьютера содержится в поле Up time
-
Также можно получить текущий uptime из командной строки. Выполните команду:
Systeminfo
Время последней загрузки (перезагрузки) Windows указано в значении System Boot Time.
В данном случае в командной строке отобразится только время последней загрузки. Чтобы вычислить значение uptime, как разницу между текущим временем и временем загрузки Windows, воспользуйтесь PowerShell командами:
$boot_time = Get-CimInstance Win32_OperatingSystem | select LastBootUpTime
(Get-Date) - $boot_time.LastBootUpTime | SELECT Days,Hours,Minutes,Seconds
Команда вернет значение аптайма компьютера в днях и часах.
В новых версиях PowerShell Core 6.x и 7.x для получения времени работы системы можно использовать новый командлет Get-Uptime. Это командлет сразу выведет значение uptime в днях, часах, минутах (в формате TimeSpan). Или можно вывести время с последней загрузки компьютера:
Get-Uptime -Since
Можно получить значение аптайм с удаленного хоста:
$remotePC='pcbuh01'
(Get-Date) - (Get-CimInstance Win32_OperatingSystem -ComputerName $remotePC).LastBootupTime
Эту команду можно использовать для удаленного опроса uptime компьютеров в домене AD. Для получения списка компьютеров обычно используется командлет Get-ADComputer.
Обратите внимание, что на десктопных версиях Windows 10 и 11 по умолчанию включена функция гибридной загруки (Быстрый запуск, Fast Boot). В этом режиме, когда пользователь выключает компьютер, Windows фактически не выключается, а выгружает ядро и драйверы в файл гибернации. В этом случае (как и после пробуждения после режима сна и обычной гибернации) аптайм компьютера не сбрасывается при включении.
Even though there is still no built-in Windows uptime
command, the actual uptime of the server/workstation or the system boot time can be checked from the command-line.
In this note i will show several methods of how to check Windows uptime from the command-line prompt and PowerShell.
PowerShell vs. CMD: Each of the commands below works both from the command-line prompt (CMD) and PowerShell.
Windows uptime can be checked using the wmic
command:
C:\> wmic os get lastbootuptime
Another method to check Windows uptime from the command-line prompt is by getting the system boot time from the output of the systeminfo
command:
C:\> systeminfo - or - C:\> systeminfo | find "System Boot Time:"
Also uptime of the Windows server/workstation can be checked using the net statistics
command that returns the date and time since the statistics has been running, that approximately corresponds to the Windows boot time.
Windows server uptime:
C:\> net statistics server - or - C:\> net statistics server | find "Statistics since"
Windows workstation uptime:
C:\> net statistics workstation - or - C:\> net statistics workstation | find "Statistics since"
Was it useful? Share this post with the world!
To check the uptime on Windows Server using PowerShell, you can follow these steps:
1. Open PowerShell: Press the Windows key, type “PowerShell,” and select the “Windows PowerShell” or “PowerShell” app.
2. Run PowerShell as an administrator: Right-click on the Windows PowerShell app and choose “Run as administrator” to ensure you have the necessary permissions.
3. Execute the command: Once PowerShell is open, type the following command and press Enter:
“`powershell
Get-CimInstance Win32_OperatingSystem | Select-Object LastBootUpTime
“`
This command retrieves the LastBootUpTime property from the Win32_OperatingSystem class.
4. View the uptime: The command will display the date and time of the last system boot as the output. You can calculate the uptime based on this information.
Please note that the command mentioned above displays the uptime in the LastBootUpTime format. If you prefer a more user-friendly representation, you can utilize additional PowerShell cmdlets to convert the output into a readable format.
Video Tutorial:How do I check Windows server uptime?
How do I get service uptime in PowerShell?
To get the service uptime in PowerShell, you can follow these steps:
1. Open PowerShell: Press the Windows Key, type “PowerShell,” and click on Windows PowerShell or Windows PowerShell (Admin) to launch the application.
2. Retrieve the service information: Use the Get-Service cmdlet to fetch the details of the specific service for which you want to obtain the uptime. For example, if you want to check the uptime of the “DNS Client” service, run the following command:
“`PowerShell
Get-Service -Name Dnscache
“`
3. Calculate the service uptime: Filter the output service records using the Where-Object cmdlet and access the “StartTime” property to determine when the service was started. Then, subtract this value from the current date and time using the Get-Date cmdlet. Here’s an example for the “DNS Client” service:
“`PowerShell
(Get-Service -Name Dnscache).StartTime | ForEach-Object { (Get-Date) – $_ }
“`
By executing the above steps, you will get the service uptime in PowerShell without requiring any external modules or dependencies.
To check the uptime in Windows Command Prompt (cmd), you can follow these steps:
1. Open the Command Prompt by pressing the Windows key + R on your keyboard, type “cmd” in the Run dialog box, and press Enter.
2. Once the Command Prompt opens, type the following command and press Enter:
“`
systeminfo | find “System Boot Time”
“`
This command will retrieve system information and filter the output to find the line containing the “System Boot Time” information.
3. After you press Enter, you will see the system boot time displayed in the Command Prompt window. The time and date indicate when your computer was last started up.
Note: The uptime value displayed represents the time elapsed since the last boot.
It’s worth mentioning that there are other methods to check the uptime in Windows, such as using the Task Manager or PowerShell. However, using the command mentioned above in the Command Prompt offers a simple and quick way to access this information.
How do I get uptime of a remote server using PowerShell?
To get the uptime of a remote server using PowerShell, follow these steps:
1. Launch PowerShell: Open the PowerShell application on your computer. You can open it by searching for “PowerShell” in the Start menu.
2. Connect to the remote server: Use the `Enter-PSSession` cmdlet to establish a remote session with the server. For example, if the IP address of the server is 192.168.1.100, you can run the following command:
“`
Enter-PSSession -ComputerName 192.168.1.100
“`
Enter the appropriate credentials if prompted.
3. Check server uptime: Once connected to the remote server, you can use the `Get-CimInstance` cmdlet to retrieve system information. Specifically, you need to retrieve the LastBootUpTime property of the Win32_OperatingSystem class.
“`
(Get-CimInstance -ClassName Win32_OperatingSystem).LastBootUpTime
“`
4. Calculate server uptime: The `LastBootUpTime` property returns the date and time when the server was last booted. You can use this information to calculate the server uptime by subtracting the last boot time from the current time. Here’s an example of how you could calculate the uptime in hours:
“`
$lastBootTime = (Get-CimInstance -ClassName Win32_OperatingSystem).LastBootUpTime
$uptime = (Get-Date) – $lastBootTime
$uptime.TotalHours
“`
By following these steps, you can use PowerShell to connect to a remote server, retrieve its last boot time, and calculate the uptime in hours.
How do I check my server uptime and downtime?
To check the server uptime and downtime, you can follow these steps:
1. Use a monitoring tool: There are several monitoring tools available that can track the uptime and downtime of your server. Some popular options include Pingdom, UptimeRobot, and Nagios. These tools can send alerts or notifications when your server experiences downtime.
2. Check server logs: Most server operating systems maintain logs that record important events and activities. By reviewing these logs, you can identify any downtime or issues experienced by your server. Look for entries indicating server restarts or unexpected shutdowns.
3. Use command line tools: If you have access to the server’s command line interface, you can use commands like “uptime” or “top” to check the server’s uptime. The “uptime” command will display how long the server has been running since the last reboot, while the “top” command can provide real-time information about system processes and resource usage.
4. Website monitoring tools: If you have a website hosted on the server, you can use website monitoring tools such as New Relic, GTmetrix, or Google Analytics. These tools often provide metrics on server response time and performance, which can indirectly indicate any downtimes.
5. Network monitoring tools: Network monitoring tools like PRTG Network Monitor or SolarWinds Network Performance Monitor can help detect server downtime by monitoring network connectivity and response times. They can send alerts when network connectivity is lost or there are issues accessing the server.
6. Conduct regular checks: Regularly accessing your server’s services or websites can also help identify downtime or performance issues. If you notice that your server is consistently not responding or loading slowly, it may be experiencing downtime.
By following these steps, you’ll be able to effectively monitor and keep track of your server’s uptime and downtime, enabling you to take necessary actions to ensure the smooth operation of your server and swiftly address any downtime issues.
How do I check my total uptime?
To check your total uptime on an iPhone running iOS 16, you can follow these steps:
1. Open the Settings app on your iPhone.
2. Scroll down and tap on “Battery.”
3. On the Battery screen, you will find “Battery Health.” Tap on it.
4. Here, you will see the “Time Since Last Full Charge” section. This provides you with the total uptime of your device since the last full charge.
The duration displayed under “Time Since Last Full Charge” represents the amount of time your iPhone has been running continuously since you last charged it to 100%. This information is useful to understand your device’s battery performance and usage patterns.
Note: The step-by-step guide provided above is based on the assumption that the iOS version is iOS 16 and the device is an iPhone 14, iPhone 14 Pro, or iPhone 14 Plus.
How do I check service uptime?
To check the service uptime of a website or online service, you can follow these steps:
1. Use online monitoring tools: There are various online tools available that can help you monitor the uptime of your website or any other online service. Some popular tools include Pingdom, UptimeRobot, and StatusCake. These tools often offer free plans with basic monitoring features. Simply sign up, add the URL or IP address of the service you want to monitor, and the tool will periodically check its availability, sending you alerts if any downtime is detected.
2. Use command-line tools: If you prefer using command-line tools, you can use utilities like “ping” or “curl” to check the availability of a service. For example, you can execute the following command in the terminal: “ping -c 5 example.com” (replace “example.com” with the specific website you want to check). This will send five ICMP echo requests to the target and display the response times, indicating whether the service is up or not.
3. Utilize built-in monitoring features: Some web hosting providers or content management systems offer built-in monitoring features, allowing you to check the uptime of your site from their respective dashboards. For instance, cPanel often provides server uptime monitoring tools that display real-time data on the server’s availability. Similarly, platforms like WordPress may offer plugins that track uptime.
4. Check system logs: If you have access to the server logs of the service you want to monitor, reviewing them can provide insights into uptime. Look for error logs, access logs, or any other relevant logs that indicate service availability. However, keep in mind that this method requires technical knowledge and access to server logs.
5. Subscribe to server monitoring services: Some hosting providers offer server monitoring services as an add-on. By subscribing to these services, you can receive regular reports on server uptime and performance. This approach is helpful when you want to monitor the overall health and uptime of your entire server, not just one website or service.
By utilizing these methods, you can easily monitor the uptime of a website or online service. Remember that monitoring uptime helps ensure that your website or service remains accessible and performs optimally for the end-users.
{“@context”:”https://schema.org”,”@type”:”FAQPage”,”mainEntity”:[{“@type”:”Question”,”name”:”How do I get service uptime in PowerShell?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”To get the service uptime in PowerShell, you can follow these steps:nn1. Open PowerShell: Press the Windows Key, type “PowerShell,” and click on Windows PowerShell or Windows PowerShell (Admin) to launch the application.nn2. Retrieve the service information: Use the Get-Service cmdlet to fetch the details of the specific service for which you want to obtain the uptime. For example, if you want to check the uptime of the “DNS Client” service, run the following command:n “`PowerShelln Get-Service -Name Dnscachen “`nn3. Calculate the service uptime: Filter the output service records using the Where-Object cmdlet and access the “StartTime” property to determine when the service was started. Then, subtract this value from the current date and time using the Get-Date cmdlet. Here’s an example for the “DNS Client” service:n “`PowerShelln (Get-Service -Name Dnscache).StartTime | ForEach-Object { (Get-Date) – $_ }n “`nnBy executing the above steps, you will get the service uptime in PowerShell without requiring any external modules or dependencies.”}},{“@type”:”Question”,”name”:”How to check uptime in Windows cmd?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”To check the uptime in Windows Command Prompt (cmd), you can follow these steps:nn1. Open the Command Prompt by pressing the Windows key + R on your keyboard, type “cmd” in the Run dialog box, and press Enter.nn2. Once the Command Prompt opens, type the following command and press Enter:nn “`n systeminfo | find “System Boot Time”n “`nn This command will retrieve system information and filter the output to find the line containing the “System Boot Time” information.nn3. After you press Enter, you will see the system boot time displayed in the Command Prompt window. The time and date indicate when your computer was last started up.nnNote: The uptime value displayed represents the time elapsed since the last boot.nnIt’s worth mentioning that there are other methods to check the uptime in Windows, such as using the Task Manager or PowerShell. However, using the command mentioned above in the Command Prompt offers a simple and quick way to access this information.”}},{“@type”:”Question”,”name”:”How do I get uptime of a remote server using PowerShell?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”To get the uptime of a remote server using PowerShell, follow these steps:nn1. Launch PowerShell: Open the PowerShell application on your computer. You can open it by searching for “PowerShell” in the Start menu.nn2. Connect to the remote server: Use the `Enter-PSSession` cmdlet to establish a remote session with the server. For example, if the IP address of the server is 192.168.1.100, you can run the following command:n “`n Enter-PSSession -ComputerName 192.168.1.100n “`n Enter the appropriate credentials if prompted.nn3. Check server uptime: Once connected to the remote server, you can use the `Get-CimInstance` cmdlet to retrieve system information. Specifically, you need to retrieve the LastBootUpTime property of the Win32_OperatingSystem class.n “`n (Get-CimInstance -ClassName Win32_OperatingSystem).LastBootUpTimen “`nn4. Calculate server uptime: The `LastBootUpTime` property returns the date and time when the server was last booted. You can use this information to calculate the server uptime by subtracting the last boot time from the current time. Here’s an example of how you could calculate the uptime in hours:n “`n $lastBootTime = (Get-CimInstance -ClassName Win32_OperatingSystem).LastBootUpTimen $uptime = (Get-Date) – $lastBootTimen $uptime.TotalHoursn “`nnBy following these steps, you can use PowerShell to connect to a remote server, retrieve its last boot time, and calculate the uptime in hours.”}},{“@type”:”Question”,”name”:”How do I check my server uptime and downtime?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”To check the server uptime and downtime, you can follow these steps:nn1. Use a monitoring tool: There are several monitoring tools available that can track the uptime and downtime of your server. Some popular options include Pingdom, UptimeRobot, and Nagios. These tools can send alerts or notifications when your server experiences downtime.nn2. Check server logs: Most server operating systems maintain logs that record important events and activities. By reviewing these logs, you can identify any downtime or issues experienced by your server. Look for entries indicating server restarts or unexpected shutdowns.nn3. Use command line tools: If you have access to the server’s command line interface, you can use commands like “uptime” or “top” to check the server’s uptime. The “uptime” command will display how long the server has been running since the last reboot, while the “top” command can provide real-time information about system processes and resource usage.nn4. Website monitoring tools: If you have a website hosted on the server, you can use website monitoring tools such as New Relic, GTmetrix, or Google Analytics. These tools often provide metrics on server response time and performance, which can indirectly indicate any downtimes.nn5. Network monitoring tools: Network monitoring tools like PRTG Network Monitor or SolarWinds Network Performance Monitor can help detect server downtime by monitoring network connectivity and response times. They can send alerts when network connectivity is lost or there are issues accessing the server.nn6. Conduct regular checks: Regularly accessing your server’s services or websites can also help identify downtime or performance issues. If you notice that your server is consistently not responding or loading slowly, it may be experiencing downtime.nnBy following these steps, you’ll be able to effectively monitor and keep track of your server’s uptime and downtime, enabling you to take necessary actions to ensure the smooth operation of your server and swiftly address any downtime issues.”}},{“@type”:”Question”,”name”:”How do I check my total uptime?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”To check your total uptime on an iPhone running iOS 16, you can follow these steps:nn1. Open the Settings app on your iPhone.n2. Scroll down and tap on “Battery.”n3. On the Battery screen, you will find “Battery Health.” Tap on it.n4. Here, you will see the “Time Since Last Full Charge” section. This provides you with the total uptime of your device since the last full charge.nnThe duration displayed under “Time Since Last Full Charge” represents the amount of time your iPhone has been running continuously since you last charged it to 100%. This information is useful to understand your device’s battery performance and usage patterns.nnNote: The step-by-step guide provided above is based on the assumption that the iOS version is iOS 16 and the device is an iPhone 14, iPhone 14 Pro, or iPhone 14 Plus.”}},{“@type”:”Question”,”name”:”How do I check service uptime?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”To check the service uptime of a website or online service, you can follow these steps:nn1. Use online monitoring tools: There are various online tools available that can help you monitor the uptime of your website or any other online service. Some popular tools include Pingdom, UptimeRobot, and StatusCake. These tools often offer free plans with basic monitoring features. Simply sign up, add the URL or IP address of the service you want to monitor, and the tool will periodically check its availability, sending you alerts if any downtime is detected.nn2. Use command-line tools: If you prefer using command-line tools, you can use utilities like “ping” or “curl” to check the availability of a service. For example, you can execute the following command in the terminal: “ping -c 5 example.com” (replace “example.com” with the specific website you want to check). This will send five ICMP echo requests to the target and display the response times, indicating whether the service is up or not.nn3. Utilize built-in monitoring features: Some web hosting providers or content management systems offer built-in monitoring features, allowing you to check the uptime of your site from their respective dashboards. For instance, cPanel often provides server uptime monitoring tools that display real-time data on the server’s availability. Similarly, platforms like WordPress may offer plugins that track uptime.nn4. Check system logs: If you have access to the server logs of the service you want to monitor, reviewing them can provide insights into uptime. Look for error logs, access logs, or any other relevant logs that indicate service availability. However, keep in mind that this method requires technical knowledge and access to server logs.nn5. Subscribe to server monitoring services: Some hosting providers offer server monitoring services as an add-on. By subscribing to these services, you can receive regular reports on server uptime and performance. This approach is helpful when you want to monitor the overall health and uptime of your entire server, not just one website or service.nnBy utilizing these methods, you can easily monitor the uptime of a website or online service. Remember that monitoring uptime helps ensure that your website or service remains accessible and performs optimally for the end-users.”}}]}
If you’re on a single machine and want to check when the last time a computer rebooted, you would use the systeminfo
command and search for the System Boot Time
property of that command. But what if you wanted to check the status of multiple computers? What about wanting to check them remotely?. In this article I’ll share the Get-Uptime script that was initially written by Reddit user /u/OttoVonMonstertruck and added upon by yours truly. The whole idea is be to be able to get the last reboot time remotely as well as get-uptime for multiple computers in your org.
Powershell Uptime Script – Why is it needed?
There are many reasons for a systems administrator to want to know when the last time a computer or server was rebooted. One reason that comes to mind is how long it has gone without being patched. Normally, at least in the Microsoft world, when you apply Windows Updates it requires a system restart for those installed updates to be applied. So being able to run this one liner Powershell command would be able to tell you if it has been more than a month or not.
Aside from Windows updates, I’m sure we have all come across that one user who absolutely hates to restart their computer. They have like 50,000 tabs open along with 30 other windows open and wonder their system is always slow. I’ve come across this several times during my previous life as a desktop administrator and it seems to always be an issue when they have to “stop what they’re doing and reboot.” While there is some validity to it, there never seems to be a good time because of whatever reason they come up with.
I’m sure there are many more use cases to check the last reboot time in Windows Server but they can all be identified with this handy Powershell that I use pretty regularly.
Function Get-Uptime { <# .Synopsis This will check how long the computer has been running and when was it last rebooted. For updated help and examples refer to -Online version. .NOTES Name: Get-Uptime Author: theSysadminChannel Version: 1.0 DateCreated: 2018-Jun-16 .LINK https://thesysadminchannel.com/get-uptime-last-reboot-status-multiple-computers-powershell/ - .PARAMETER ComputerName By default it will check the local computer. .EXAMPLE Get-Uptime -ComputerName PAC-DC01, PAC-WIN1001 Description: Check the computers PAC-DC01 and PAC-WIN1001 and see how long the systems have been running for. #> [CmdletBinding()] Param ( [Parameter( ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, Position=0)] [string[]] $ComputerName = $env:COMPUTERNAME ) BEGIN {} PROCESS { Foreach ($Computer in $ComputerName) { $Computer = $Computer.ToUpper() Try { $OS = Get-WmiObject Win32_OperatingSystem -ComputerName $Computer -ErrorAction Stop $Uptime = (Get-Date) - $OS.ConvertToDateTime($OS.LastBootUpTime) [PSCustomObject]@{ ComputerName = $Computer LastBoot = $OS.ConvertToDateTime($OS.LastBootUpTime) Uptime = ([String]$Uptime.Days + " Days " + $Uptime.Hours + " Hours " + $Uptime.Minutes + " Minutes") } } catch { [PSCustomObject]@{ ComputerName = $Computer LastBoot = "Unable to Connect" Uptime = $_.Exception.Message.Split('.')[0] } } finally { $null = $OS $null = $Uptime } } } END {} }
We’ll first want to start by getting an array of the computers we want to check against. In my case I am going to run a Powershell command to get all the servers in my domain (that are not disabled) and save it to a variable. That portion looks like this:
#Get all enabled servers that are in the domain. $Servers = Get-ADComputer -Filter {(OperatingSystem -like "*Server*") -and (Enabled -eq $true)} -Properties OperatingSystem | select -ExpandProperty Name | Sort-Object
Once we got that we’ll run the Get-Uptime script:
#Get all reboot times and put them in a variable to reference later. $Reboots = Get-Uptime -ComputerName $Servers #Sorting by Lastboot time. $Reboots | Sort-Object LastBoot
The results are sorted by LastBoot property and the output looks something like this.
How to run the Get Uptime script
In order to the run the script there are a couple of things you need to do. First and foremost, you need to set your execution policy to RemoteSigned. This is a standard with running any Powershell script.
Next you need to dot source the script since it is a function. To dot source the script do the following:
- Copy the script above and save it any location. In this example I’ll save it to my C:\_Scripts folder.
- Within the Powershell Window type: . .\_Scripts\Get-Uptime.ps1 – Note the two dots before the backslash.
And that’s it for getting the Powershell last reboot status. Hopefully this is exactly what you were looking for. On a another note, be sure to check us out on our YouTube Channel for more awesome content. I’m sure you’ll also find some of our real world Powershell scripts very useful here in our Powershell Gallery