I am getting below error while running script to get uptime of servers, for few servers it is working fine where as for others I am getting blank box instead of server up time .I am having same access on all the servers but still only for few I am facing this issue
Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
At C:\Scripts\New folder\script.ps1:48 char:22
+ $OperatingSystem = Get-WmiObject Win32_OperatingSystem -ComputerName $ServerNa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-WmiObject], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
Exception calling "ToDateTime" with "1" argument(s): "Specified argument was out of the range of valid values.
Parameter name: dmtfDate"