Jump to content

Recommended Posts

Posted

Hi,

 

I have a Server 2012 with Windows 7,8 and 10 clients.

 

Can anyone tell me if there is a command I can run to view the uptime for all switched on computers on the domain?

Posted
Get Uptime of a computer - PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources

 

This looks pretty close to something you are looking for, I'm just wondering what would happen if you replaced Line 33 with a "*" rather than "."

 

Thanks, a useful link.

I did try replacing the . with an *, but sadly, it didn't like it:

 

PS C:\users\Administrator\desktop> [color="#FFFF00"].\Get-Uptime.ps1[/color]
[color="#FF0000"]Get-WMIObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
At C:\users\talksr\desktop\Get-Uptime.ps1:34 char:14
+ ... computers = Get-WMIObject -class Win32_OperatingSystem -computer $com ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   + CategoryInfo          : InvalidOperation: ( [Get-WmiObject], COMException
   + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand[/color]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...