Author Posts

May 18, 2017 at 7:56 am

$ip = '\\192.168.233.128\Test'
 $password = "abc123!" | ConvertTo-SecureString -asPlainText -Force
 $username = "Administrator" 
 $credential = New-Object System.Management.Automation.PSCredential($username,$password)
 New-PSDrive -Name Z -PSProvider FileSystem -Root $ip -Credential $credential -ErrorAction Stop 
 dir C:\File_One.txt | copy -Destination Z: -PassThru
 Remove-PSDrive -name Z

This Code Works fine between my base machine and VM, It also worked with another PC connected to my router.
But when i tried Implementing it on clients network it doesn't let me create the PSDrive, and Script Failed.
The credentials provided were correct.

Any help would be beneficial.

May 18, 2017 at 1:26 pm

if you do the action manaul does it give an error? Then you can see if it has to do something with rights/policy