![]() ![]() The above command gets the last reboot time of the local computer and prints Host Name and System Boot Time on the terminal as given below PS C:\> systeminfo | Select-String "Host Name","System Boot Time" systeminfo | Select-String "Host Name","System Boot Time" You can use the systeminfo command to get the last boot time of the computer. Get last boot time of computer using systemInfo Workstation Statistics for \\INCORP-EU-D101 ![]() The output of the above command is given below PS C:\> net statistics workstation | select-string "Statistics" The net statistics command gets the last boot time of the computer. net statistics workstation | select-string "Statistics" The net statistics command displays statistics about the system like bytes received, system errors, last boot time of computer, and total uptime of computer from last boot of computer. INCORP-EU-D101 21-10-2021 16:00:35 Find last reboot time of computer using net statistics The output of the above script is as given below PS C:\> Get-CimInstance -ClassName win32_operatingsystem | select csname, lastbootuptime In the second command, it selects csname and lastbootuptime property and displays the last boot time of the local computer. Get-CimInstance uses win32_operatingsystem class name to get system information and passes the information through the pipeline operator to the second command. Get-CimInstance -ClassName win32_operatingsystem | select csname, lastbootuptime You can use the PowerShell Get-CimInstance cmdlet to get the system last boot time. 7 Conclusion Get last boot time of computer using Get-CimInstance ![]()
0 Comments
Leave a Reply. |