This topic contains 3 replies, has 3 voices, and was last updated by
October 16, 2018 at 11:24 am #114181ParticipantPoints: 0Rank: 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 ?
October 16, 2018 at 11:31 am #114187ParticipantPoints: 77Rank: Member
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
October 16, 2018 at 1:27 pm #114201ParticipantPoints: 2Rank: 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.
October 16, 2018 at 1:45 pm #114202ParticipantPoints: 0Rank: 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.