Please forgive my ignorance but I never tried powershell before. I downloaded it off microsoft and attempted the suggestions. I tried researching some guides and websites to try and answer my own questions before posting but I don't know where to start.
You have to be an administrator to run WMIC. "Access Denied' is usually permissions. If you are not an administrator then you will NOT be able to use PsExec either.
Using POwerShell on the local PC will allow you to use WMI without being an adminnistrator. I am pretty sure that you can get the boot time without being an admin.
Here is the remote PowerShell code;
Code: Select all
gwmi win32_operatingsystem -computer computer1 | select csname, lastbootuptime
I ran this locally on my workstation and it displayed the results. So I confirmed the powershell was working when ran locally for me, but I cannot get powershell installed on each of the workstations.
You can run it like this.
Code: Select all
$computers = 'comp1','comp2',comp3'
gwmi win32_operatingsystem -computer $computers | select csname, lastbootuptime
This will give you back a list with all of the computer names and times.
I tried running this, substituting '10.13.202.21' for 'comp1' and received the following. I am a local admin on my workstation and the powershell title does state administrator(not sure if that makes any difference):
Get-WmiObject : Access is denied. (exception from HRESULT: 0x80070005 (E_ACCESS DENIED))
At line:1 char:5
= gwmi<<<< win32_operatingsystem - computer $computers: select csname, lastbootuptime
+ Category information : NotSpecified (:) [Get-WmiObject], UnauthorizedAccessException
+FullyQualifiedErrorID: System.UnauthorizedAccessExcetion,Microsoft.powershell.commands.getwmiobjectcommand
Any suggestions?