Getting an error.. Get-wmiObject : access is denied

70 Views Asked by At

I am actually fetching some basic system information for a remote desktop by using powershell but i am facing an error..

$remoteComputer = "IP address of the remote computer"

$desktopInfo = Get-WmiObject -Class Win32_Computer SystemProduct -ComputerName $remoteComputer

$serialNumber = $desktopInfo. IdentifyingNumber

$model = $desktopInfo.Name

$systemInfo = Get-WmiObject -Class Win32_ComputerSystem -ComputerName $remoteComputer

$systemName = $systemInfo.Name

$processorInfo = Get-WmiObject -Class Win32_Processor -ComputerName $remoteComputer

$processorName= $processorInfo. Name

Write-Host "System Name: $systemName"

Write-Host "Processor Name: $processorName"

Write-Host "Serial Number: $serialNumber"

Write-Host "Model: Smodel"

image of the error that i getting

Please i am kinda new to powershell...If anyone has any idea please share it with me

0

There are 0 best solutions below