WMI Objects

This topic contains 2 replies, has 2 voices, and was last updated by  Kasun Rajapakse 3 years, 5 months ago.

  • Author
  • #21549

    Kasun Rajapakse


    when I following tutorials i face this issue

    [u][b]Method 1[/b][/u]

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

    then i try as follows

    [u][b]Method 2[/b][/u]

    [b]Enter-PSSession -ComputerName lon-svr1[/b]

    [b]Get-WmiObject -Class win32_bios -ComputerName lon-svr1[/b]

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


    Kasun Rajapakse

  • #21551

    Richard Siddaway

    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

    • #21552

      Kasun Rajapakse


      Thanks for the reply appreciate it 🙂

You must be logged in to reply to this topic.