I find myself constantly checking servers to figure out what time they last restarted. Usually, this is part of troubleshooting something in order to figure out whether the server rebooted as a planned action or if something went wrong and it restarted on its own during a non-standard time. For years, I had launched Event Viewer, waited for the System logs to open, hoped that they weren't corrupted in some way, and then headed over to noon on the previous day to find the amount of seconds that the system had been online. Then I'd pull out the calculator and do the math on how many days/hours that really was. Way too complicated! Thankfully, we can make calls into WMI objects with PowerShell, and there is an object in there that will tell us the last time the server started. With a few lines plugged into a .ps1
script, we can create ourselves a nice little tool that will output the last time that a server booted. Let's give it a try.
Windows Server 2012 R2 Administrator Cookbook
By :
Windows Server 2012 R2 Administrator Cookbook
By:
Overview of this book
Table of Contents (17 chapters)
Windows Server 2012 R2 Administrator Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Learning the Interface
Core Infrastructure Tasks
Security and Networking
Working with Certificates
Internet Information Services
Remote Access
Remote Desktop Services
Monitoring and Backup
Group Policy
File Services and Data Control
Index
Customer Reviews