Displaying Services on a remote computer

This topic contains 2 replies, has 3 voices, and was last updated by  js 1 week, 5 days ago.

  • Author
  • #104075

    Joe Maruca

    Hello everyone,
    I am trying to run a PowerShell script that displays Windows Services on a Remote Computer using the correct security credentials however, I am being presented with the Error Response below; does anyone know why this is happening?, thank you in advance ...

    PowerShell Code
    $cred = get-Credential -credential domain\user_name
    $computer = "Remote_Hostname"
    Get-WMIObject Win32_Service -computerName $computer -credential $cred

    Error Response
    Get-WMIObject : Call was canceled by the message filter. (Exception from HRESULT: 0x80010002 (RPC_E_CALL_CANCELED))
    At line:3 char:1
    + Get-WMIObject Win32_Service -computerName $computer -credential $cred
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], COMException
    + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

  • #104078

    Richard Siddaway

    This appears to be a WMI issue on the machine to which you're trying to connect

    Try RDPing into the server and making the call locally – if should still fail if its a WMI issue on that server

    then try restarting the WMI service and run get-wmiobject again

    if it still fails try running wbemtest

    if you don't get any success you may have to rebuild the WMI repository

  • #104080


    You can try get-ciminstance instead, if wsman works instead of dcom.

You must be logged in to reply to this topic.