KnockDown
KnockDown

Reputation: 171

Windows 10 - WMIC/WMI Remote Access denied with local administrator

First my workingsetup:

DesktopPC: Windows 10 Pro, Version: 10.0.10586 Build: 10586, 64-Bit
Laptop: Windows 10 Pro, Version: 10.0.10586 Build: 10586, 64-Bit
User: Both computers have the same username {zuka} & password {blah}.

I tried to connect remotely, with WMIC to my DesktopPC, with my Laptop and to execute a query.
I typed these following shell commands into Powershell:

    PS C:\Windows\system32> wmic
    wmic:root\cli> /user: zuka
    Please enter the password:blah
    wmic:root\cli> /node: {IP-Address of my DesktopPC}
    wmic:root\cli> csproduct get /value
    Node - {IP-Address of my DesktopPC}
    Error:
    Description = Access is denied.

Or with:

    get-wmiobject CIM_Memory -computername desktopPC { or IP } -credential zuka

I get a errormessage like:

    Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

I tried to resolve the problem with these following steps: ( But none of them worked :[ )

Is there a specific issue with Windows 10 or did I miss a certain configuration?

Upvotes: 1

Views: 26348

Answers (2)

KnockDown
KnockDown

Reputation: 171

To enable remote access for other PC's on WMI, it is needed to add the hosts into the trustedhost-list in winrm, if the computers aren't in the same or any domain.

  1. Enable winrm. On the computer, you want to access.
    Check if winrm is running or stopped:

    get-service winrm
    

    If it is stopped, type:

    enable-PSRemoting -force
    

    Add access permission to the remote host.

    winrm s winrm/config/client '@{TrustedHosts="REMOTECOMPUTERNAME/IP"}'
    

    So in my case:

    winrm s winrm/config/client '@{TrustedHosts="laptopPC"}'
    

    To verify the winrm service, you can type:

    winrm quickconfig
    

    It will give the current status of the service and if needed, it will configure the WinRM service.

  2. Unfortunately the windows firewall is blocking the remote access.

    1. Go into Windows Firewall with Advanced security > inbound rules mode
    2. Right-click in the working area & choose New Rule...
    3. Choose the predefined option and select Windows Management Instrumentation (WMI) from the drop-down list and click next.
    4. Now select the option: (WMI-In) rule with the local profile value.
    5. Allow the connection > Finish.

Now I can acces the WMI from my laptopPC to my desktopPC with this following commandline:

 get-wmiobject CIM_Memory -computername desktopPC { or IP } -credential zuka

And then it asks for the password. And voilà! I got the information of the memory, trought remote access. =)

Upvotes: 13

Mike Garuccio
Mike Garuccio

Reputation: 2718

Unless you have a domain set up at home it looks like your passing an incorrect credential. the user should have a machine qualifier in front of it. so "/user: desktopPC\zuka"

Upvotes: 0

Related Questions