Earlier this year I wrote a PowerShell module to get uptime information. The module was part of a series I wrote for Petri.com. As part of my ongoing project to move some of my more interesting, and hopefully useful, tools to GitHub, I revised the module. The new version makes better use of custom format and type extensions, including the addition of several methods.
ManageEngine ADManager Plus - Download Free Trial
Exclusive offer on ADManager Plus for US and UK regions. Claim now!
You can also now use a CIMSession instead of a computername and the results are "live". Because I defined some script properties, uptime values are updated every time you view the object. I will be writing about the changes in more detail on Petri.com. But for now, you can find the module on GitHub. I hope you'll let me know what you think and what would make it even better.
“The command uses the CIM cmdlets so any remote computer must be running at least PowerShell 3.0 with remoting enabled”
What about forcing the session to use the DCOM protocol? That way you can hit older OS’s regardless of PowerShell Version..?
I didn’t want to get bogged down with code for legacy systems that soon should go away. The alternative is to first create CIMSessions with appropriate options and then pipe those sessions to the command.
Actually, you can’t pipe CIMSessions right now. You have to do this: get-myuptime -CimSession (get-cimsession)
I should modify the command.
The latest version on GitHub now lets you pipe CIMSessions to Get-MyUptime.