none
WinRS : How to Use?

    Question

  • Hi

    I'm trying to connect two servers 2003 by using WINRS/WINRM : firstdom.mywebsite.com and secdom.mywebsite.com. They are in different servers.
    I did setup those on both servers and both of course have remote access.

    I used below command in CMD.exe in secdom:

    winrs -r:http://firstdom.mywebsite.com -u:username -p:password cmd.exe

    for both i got:

    "Winrs error:The WinRM client cannot process the request. If the authentication s-
    cheme is different from Kerberos, or if the client computer is not joined to a d-
    omain, then HTTPS transport must be used or the destination machine must be adde-
    d to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedH-
    osts. You can get more information about that by running the following command:
    winrm help config."

    I added the domain by using below :

    winrm set winrm/config/client @{TrustedHosts="firstdom.mywebsite.com"}

    Result:

    Client
        NetworkDelayms = 5000
        URLPrefix = wsman
        AllowUnencrypted = false
        Auth
            Basic = false
            Digest = true
            Kerberos = true
            Negotiate = true
            Certificate = true
        DefaultPorts
            HTTP = 80
            HTTPS = 443
        TrustedHosts = firstdom.mywebsite.com

    I ran the same command as below:

    winrs -r:http://firstdom.mywebsite.com -u:username -p:password cmd.exe

    Result:

    "Winrs error:WS-Management cannot process the request. The operation failed becau
    se of an HTTP error. The HTTP error (12030) is: The connection with the server w
    as terminated abnormally."

    What am I doing wrong?
    Wednesday, September 02, 2009 8:08 AM

Answers

  • ok
    to solve this problem

    I used a batch file and I wrote
    winrs -r:http://firstdom.mywebsite.com -u:username -p:password cmd.exe
    into the file. then I used invoke-expression to run the batch file and delete at the end.

    also for security, because there are different servers in my company and their security and networking are complex; I don how I fixed it, but the funny part was:

    Fail connection:
    my-computer -> server 1
    my-computer -> server 2

    Successful connection:

    Server 1 -> Server 2
    Server 2 -> Server 1
    • Proposed as answer by David Shen Tuesday, September 08, 2009 6:57 AM
    • Marked as answer by David Shen Wednesday, September 09, 2009 4:06 AM
    Tuesday, September 08, 2009 4:02 AM

All replies

  • Hi there,

    please take a look at http://msdn.microsoft.com/en-us/library/aa384291(VS.85).aspx and http://blogs.technet.com/server_core/archive/2006/08/11/446122.aspx for the reference on usage of WinRS.

    Thanks and Regards,
    Scorprio
    MCTS: Windows Vista | Exchange Server 2007 MCITP: Enterprise Support Technician | Server & Enterprise Admin
    Saturday, September 05, 2009 9:40 AM
  • ok
    to solve this problem

    I used a batch file and I wrote
    winrs -r:http://firstdom.mywebsite.com -u:username -p:password cmd.exe
    into the file. then I used invoke-expression to run the batch file and delete at the end.

    also for security, because there are different servers in my company and their security and networking are complex; I don how I fixed it, but the funny part was:

    Fail connection:
    my-computer -> server 1
    my-computer -> server 2

    Successful connection:

    Server 1 -> Server 2
    Server 2 -> Server 1
    • Proposed as answer by David Shen Tuesday, September 08, 2009 6:57 AM
    • Marked as answer by David Shen Wednesday, September 09, 2009 4:06 AM
    Tuesday, September 08, 2009 4:02 AM