Remote access to a server

Welcome Forums General PowerShell Q&A Remote access to a server

This topic contains 3 replies, has 3 voices, and was last updated by

1 year ago.

  • Author
  • #114181

    Topics: 1
    Replies: 1
    Points: 0
    Rank: Member



    In my company i have to write a script that can :

    1) "Connect to an other server" (\\Serveur\x$\the\path) as a specific user (with password)

    2) "Get a html file"

    3) "Put it on the first server (x:\the\path\i\chose)


    for some reasons i can ping the remote server, i can manually access to (\\Serveur\x$\the\path) but i can't do it with Powershell.

    May i have some help ?

    Best regards,

  • #114187

    Topics: 13
    Replies: 221
    Points: 112
    Rank: Participant

    2012 and newer already have remoting enabled, you will need to enable it for anything older than 2012. If it's 2012+ and not working take a look at the links below



  • #114201

    Topics: 0
    Replies: 4
    Points: 2
    Rank: Member


    Please make a below check on the both the servers in picture.

    0. Server should ping each other and try to access SMB share for both using

    1. Check firewall settings using the below command and match
    netsh advf show allp state

    2. Check WinRM service on both machines also check if Port 5985 is responding to Telnet

    3. Check Execution Policy by command Get-ExecutionPolicy.
    Kindly set the execution policy to Unrestricted or Bypass the execution policy in order to establish connection.

    4. Try enter-pssession Server01 or invoke-command to remotely access the server.

    Incase you still face an issue do share the Error so that we can proceed further.


  • #114202

    Topics: 1
    Replies: 1
    Points: 0
    Rank: Member

    First of all thanks for your answers.

    I found some interesting things with "net use" and i tried this way :

    net use L: $from_path /user:$username $pass

    copy-item $from_path'\replication.html' -Destination $to_path

    net use L: /delete

    But the fact is that it works when i put command one by one in PowerShell but i am having a "system error 129 : Multiple connections to a server or resource shared by the same user, using more than one user name, are not allowed. Delete all previous connections to the server or shared resource and repeat."

    It is strange that it is working one way but not the other..

The topic ‘Remote access to a server’ is closed to new replies.