none
Installing Remote Management through GPO

    Question

  • I am trying to installing Remote Management through GPO.

    Environment is Server (2012 R2) as administrator and client computer is Windows 7 Professional (SP1).

    When I run this, it works

        Invoke-Command -Computer Client -ScriptBlock {Restart-Computer -Force}
    

    When I run this, it fails.

        [string]$UserID = 'MyDomain\Administrator'
        [string]$Password = "Password"
        [System.Security.SecureString] $SecurePassword = ConvertTo-SecureString  $Password -AsPlainText -Force
        $Credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ($UserID, $SecurePassword)
        Invoke-Command -Computer Client -Credential $Credentials -Authentication Basic -ScriptBlock {Restart-Computer -Force}
    

    This is the error message

    [CLIENT] Connecting to remote server CLIENT failed with the following error message : The WinRM client 
    cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is 
    not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the 
    TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts 
    list might not be authenticated. You can get more information about that by running the following command: winrm 
    help config. For more information, see the about_Remote_Troubleshooting Help topic.
        + CategoryInfo          : OpenError: (CLIENT:String) [], PSRemotingTransportException
        + FullyQualifiedErrorId : ServerNotTrusted,PSSessionStateBroken
    


    Thursday, July 14, 2016 10:27 PM

Answers

  • Hi Brian,

    Thanks for your post.

    This issue occurs if either an internal firewall or the Windows Remote Management service has not been started.

    To resolve this issue, check whether the Windows Remote Management service is installed and has started. To do this, follow these steps:

    To resolve this issue, check whether the Windows Remote Management service is installed and has started. To do this, follow these steps: 

    1. Do one of the following:
      • In Windows 8, press the Windows logo key+R to open the Run dialog box, type services.msc, and then press Enter.
      • In Windows 7 or Windows Vista, click Start, type services.msc in the Start search field, and then press Enter.
      • In Windows XP, click Start, click Run, type services.msc, and then press Enter.
    2. In the Services window, double-click Windows Remote Management.
    3. Set the startup type to Manual, and then click OK.
    4. Right-click the service, and then click Start.
    5. Let the service start.

      Note If the service was already started but it's not responding, you may have to click Restart.
    6. Try to connect to Exchange Online again.

    Best Regards,

    Jay


    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Friday, July 15, 2016 8:29 AM
    Moderator

All replies

  • Highlights from GPRESULT /V


        Applied Group Policy Objects
        -----------------------------
            Remote Managment

            
        Resultant Set Of Policies for Computer
        ---------------------------------------

            System Services
            ---------------
                GPO: Remote Managment
                    ServiceName: WinRM
                    Startup:     Automatic

            Administrative Templates
            ------------------------
                GPO: Remote Managment
                    KeyName:     Software\Policies\Microsoft\Windows\WinRM\Service\IPv6Filter
                    Value:       0, 0
                    State:       Enabled

                GPO: Remote Managment
                    KeyName:     Software\Policies\Microsoft\Windows\WinRM\Client\AllowBasic
                    Value:       1, 0, 0, 0
                    State:       Enabled

                GPO: Remote Managment
                    KeyName:     Software\Policies\Microsoft\Windows\WinRM\Service\AllowAutoConfig
                    Value:       1, 0, 0, 0
                    State:       Enabled

                GPO: Remote Managment
                    KeyName:     Software\Policies\Microsoft\Windows\PowerShell\EnableScripts
                    Value:       1, 0, 0, 0
                    State:       Enabled

                GPO: Remote Managment
                    KeyName:     Software\Policies\Microsoft\Windows\PowerShell\ExecutionPolicy
                    Value:       85, 0, 110, 0, 114, 0, 101, 0, 115, 0, 116, 0, 114, 0, 105, 0, 99, 0, 116, 0, 101, 0, 100, 0, 0, 0
                    State:       Enabled

                GPO: Remote Managment
                    KeyName:     Software\Policies\Microsoft\WindowsFirewall\PolicyVersion
                    Value:       22, 2, 0, 0
                    State:       Enabled

                GPO: Remote Managment
                    KeyName:     Software\Policies\Microsoft\Windows\WinRM\Client\AllowUnencryptedTraffic
                    Value:       1, 0, 0, 0
                    State:       Enabled

                GPO: Remote Managment
                    KeyName:     Software\Policies\Microsoft\Windows\WinRM\Service\IPv4Filter
                    Value:       42, 0, 0, 0
                    State:       Enabled

                GPO: Remote Managment
                    KeyName:     Software\Policies\Microsoft\WindowsFirewall\FirewallRules\WINRM-HTTP-In-TCP-PUBLIC
                    Value:       118, 0, 50, 0, 46, 0, 50, 0, 48, 0, 124, 0, 65, 0, 99, 0, 116, 0, 105, 0, 111, 0, 110, 0, 61, 0, 65, 0, 108, 0, 108, 0, 111, 0, 119, 0, 124, 0, 65, 0, 99, 0, 116, 0, 105, 0, 118, 0, 101, 0, 61, 0, 84, 0, 82, 0, 85, 0, 69, 0, 124, 0, 68, 0, 105, 0, 114, 0, 61, 0, 73, 0, 110, 0, 124, 0, 80, 0, 114, 0, 111, 0, 116, 0, 111, 0, 99, 0, 111, 0, 108, 0, 61, 0, 54, 0, 124, 0, 80, 0, 114, 0, 111, 0, 102, 0, 105, 0, 108, 0, 101, 0, 61, 0, 80, 0, 117, 0, 98, 0, 108, 0, 105, 0, 99, 0, 124, 0, 76, 0, 80, 0, 111, 0, 114, 0, 116, 0, 61, 0, 53, 0, 57, 0, 56, 0, 53, 0, 124, 0, 82, 0, 65, 0, 52, 0, 61, 0, 76, 0, 111, 0, 99, 0, 97, 0, 108, 0, 83, 0, 117, 0, 98, 0, 110, 0, 101, 0, 116, 0, 124, 0, 82, 0, 65, 0, 54, 0, 61, 0, 76, 0, 111, 0, 99, 0, 97, 0, 108, 0, 83, 0, 117, 0, 98, 0, 110, 0, 101, 0, 116, 0, 124, 0, 65, 0, 112, 0, 112, 0, 61, 0, 83, 0, 121, 0, 115, 0, 116, 0, 101, 0, 109, 0, 124, 0, 78, 0, 97, 0, 109, 0, 101, 0, 61, 0, 64, 0, 70, 0, 105, 0, 114, 0, 101, 0, 119, 0, 97, 0, 108, 0, 108, 0, 65, 0, 80, 0, 73, 0, 46, 0, 100, 0, 108, 0, 108, 0, 44, 0, 45, 0, 51, 0, 48, 0, 50, 0, 53, 0, 51, 0, 124, 0, 68, 0, 101, 0, 115, 0, 99, 0, 61, 0, 64, 0, 70, 0, 105, 0, 114, 0, 101, 0, 119, 0, 97, 0, 108, 0, 108, 0, 65, 0, 80, 0, 73, 0, 46, 0, 100, 0, 108, 0, 108, 0, 44, 0, 45, 0, 51, 0, 48, 0, 50, 0, 53, 0, 54, 0, 124, 0, 69, 0, 109, 0, 98, 0, 101, 0, 100, 0, 67, 0, 116, 0, 120, 0, 116, 0, 61, 0, 64, 0, 70, 0, 105, 0, 114, 0, 101, 0, 119, 0, 97, 0, 108, 0, 108, 0, 65, 0, 80, 0, 73, 0, 46, 0, 100, 0, 108, 0, 108, 0, 44, 0, 45, 0, 51, 0, 48, 0, 50, 0, 54, 0, 55, 0, 124, 0, 0, 0
                    State:       Enabled

                GPO: Remote Managment
                    KeyName:     Software\Policies\Microsoft\Windows\WinRM\Client\TrustedHosts
                    Value:       1, 0, 0, 0
                    State:       Enabled

                GPO: Remote Managment
                    KeyName:     Software\Policies\Microsoft\Windows\WinRM\Client\TrustedHostsList
                    Value:       49, 0, 57, 0, 50, 0, 46, 0, 49, 0, 54, 0, 56, 0, 46, 0, 48, 0, 46, 0, 42, 0, 0, 0
                    State:       Enabled

                GPO: Remote Managment
                    KeyName:     Software\Policies\Microsoft\WindowsFirewall\FirewallRules\WINRM-HTTP-In-TCP
                    Value:       118, 0, 50, 0, 46, 0, 50, 0, 48, 0, 124, 0, 65, 0, 99, 0, 116, 0, 105, 0, 111, 0, 110, 0, 61, 0, 65, 0, 108, 0, 108, 0, 111, 0, 119, 0, 124, 0, 65, 0, 99, 0, 116, 0, 105, 0, 118, 0, 101, 0, 61, 0, 84, 0, 82, 0, 85, 0, 69, 0, 124, 0, 68, 0, 105, 0, 114, 0, 61, 0, 73, 0, 110, 0, 124, 0, 80, 0, 114, 0, 111, 0, 116, 0, 111, 0, 99, 0, 111, 0, 108, 0, 61, 0, 54, 0, 124, 0, 80, 0, 114, 0, 111, 0, 102, 0, 105, 0, 108, 0, 101, 0, 61, 0, 68, 0, 111, 0, 109, 0, 97, 0, 105, 0, 110, 0, 124, 0, 80, 0, 114, 0, 111, 0, 102, 0, 105, 0, 108, 0, 101, 0, 61, 0, 80, 0, 114, 0, 105, 0, 118, 0, 97, 0, 116, 0, 101, 0, 124, 0, 76, 0, 80, 0, 111, 0, 114, 0, 116, 0, 61, 0, 53, 0, 57, 0, 56, 0, 53, 0, 124, 0, 65, 0, 112, 0, 112, 0, 61, 0, 83, 0, 121, 0, 115, 0, 116, 0, 101, 0, 109, 0, 124, 0, 78, 0, 97, 0, 109, 0, 101, 0, 61, 0, 64, 0, 70, 0, 105, 0, 114, 0, 101, 0, 119, 0, 97, 0, 108, 0, 108, 0, 65, 0, 80, 0, 73, 0, 46, 0, 100, 0, 108, 0, 108, 0, 44, 0, 45, 0, 51, 0, 48, 0, 50, 0, 53, 0, 51, 0, 124, 0, 68, 0, 101, 0, 115, 0, 99, 0, 61, 0, 64, 0, 70, 0, 105, 0, 114, 0, 101, 0, 119, 0, 97, 0, 108, 0, 108, 0, 65, 0, 80, 0, 73, 0, 46, 0, 100, 0, 108, 0, 108, 0, 44, 0, 45, 0, 51, 0, 48, 0, 50, 0, 53, 0, 54, 0, 124, 0, 69, 0, 109, 0, 98, 0, 101, 0, 100, 0, 67, 0, 116, 0, 120, 0, 116, 0, 61, 0, 64, 0, 70, 0, 105, 0, 114, 0, 101, 0, 119, 0, 97, 0, 108, 0, 108, 0, 65, 0, 80, 0, 73, 0, 46, 0, 100, 0, 108, 0, 108, 0, 44, 0, 45, 0, 51, 0, 48, 0, 50, 0, 54, 0, 55, 0, 124, 0, 0, 0
                    State:       Enabled


    USER SETTINGS
    --------------
        
        Applied Group Policy Objects
        -----------------------------
            N/A

    Thursday, July 14, 2016 11:11 PM
  • Hi Brian,

    Thanks for your post.

    This issue occurs if either an internal firewall or the Windows Remote Management service has not been started.

    To resolve this issue, check whether the Windows Remote Management service is installed and has started. To do this, follow these steps:

    To resolve this issue, check whether the Windows Remote Management service is installed and has started. To do this, follow these steps: 

    1. Do one of the following:
      • In Windows 8, press the Windows logo key+R to open the Run dialog box, type services.msc, and then press Enter.
      • In Windows 7 or Windows Vista, click Start, type services.msc in the Start search field, and then press Enter.
      • In Windows XP, click Start, click Run, type services.msc, and then press Enter.
    2. In the Services window, double-click Windows Remote Management.
    3. Set the startup type to Manual, and then click OK.
    4. Right-click the service, and then click Start.
    5. Let the service start.

      Note If the service was already started but it's not responding, you may have to click Restart.
    6. Try to connect to Exchange Online again.

    Best Regards,

    Jay


    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Friday, July 15, 2016 8:29 AM
    Moderator
  • Thanks for you response.

    The GPO worked. The service is started in the GPO; system services and preferences to ensure it re-starts in case of failure. The cmdlet works when the authentication method is not specified.


    Invoke-Command -Computer Client -Credential $Credentials -ScriptBlock {Restart-Computer -Force}


    Saturday, July 16, 2016 12:28 AM