WMI Objects


when I following tutorials i face this issue

Method 1

when i run Get-WmiObject -Class win32_bios -ComputerName lon-svr1 It gives me a error that RPC server is unavailable

then i try as follows

Method 2

Enter-PSSession -ComputerName lon-svr1

Get-WmiObject -Class win32_bios -ComputerName lon-svr1

when i run as the second method it works what would be the error


Kasun Rajapakse

In your first example you are trying to connect to WMI remotely and in the second you are connecting to WMI on the system itself. Get-WmiObject uses DCOM to connect to remote systems. The error message suggests that that connection can’t be made. Check to see if there is a firewall blocking DCOM and/or WMI traffic. By default the Windows firewall doesn’t allow WMI related traffic.

Alternatively use

Get-CimInstance -ClassName win32_bios -ComputerName lon-svr1

The CIM cmdlets work over WSMAN - the same as PowerShell remoting - and as you can create a remoting session to the system you should be able to use Get-CimInstance

I would recommend the CIM cmdlets over the WMI cmdlets in nearly all cases


Thanks for the reply appreciate it :slight_smile: