PSremoting in Workgroup Environment

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Abhijit Sune Abhijit Sune 2 years, 5 months ago.

  • Author
    Posts
  • #16807
    Profile photo of Abhijit Sune
    Abhijit Sune
    Participant

    Here is my problem..

    I have following parameters with me...
    – ComputerName of my remote system (Not the IP Address)
    – System is in Workgroup environment.
    – My host system is also in workgroup.
    – Both Host and remote system has WS2012 OS & in same network

    I would like to get these two system to communicate remotely.

    Following are the steps, I tried (e.g: "Server2" name of my server node)
    1) Add the computer name in trusted Host list, using following command
    winrm set winrm/config/client '@{TrustedHosts="Server2"}'
    2) Then type – Enter-PSsession -computername Server2
    -> This throws an error as "Server name cannot be resolved".

    But if we used IP address of Server2 then it starts working. I don't want to use IP address, consider that I have only Computer name of my remote system. Is there any way to get it working. Please do suggest.

    Thanks,
    Abhijit

  • #16808
    Profile photo of Don Jones
    Don Jones
    Keymaster

    First, your Enter-PSSession command will also require a -Credential parameter.

    But meantime, the problem you're running into isn't PowerShell – it's basic networking. How can your computer resolve "Server2" to an IP Address? If the DNS server your computer is using doesn't know "Server2," then your computer won't know how to physically connect to Server2. You can either add the necessary records to DNS, add an entry to your local static HOSTS file, or use an IP address – which you've already seen will work.

    But your computer won't "broadcast" the name Server2 to see if anyone responds. It needs a way to turn that name into an IP address.

    BTW, you can also set TrustedHosts by simply using the WinRM: drive in PowerShell. You don't have to run Winrm.exe. TrustedHosts will be under WinRM:\localhost\client.

  • #16836
    Profile photo of Abhijit Sune
    Abhijit Sune
    Participant

    Thanks you Don ! This info is very useful.

You must be logged in to reply to this topic.