$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.