Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $username = userdomainusername
- $password = cat C:securestring.txt | convertto-securestring
- $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
- Invoke-Command -ComputerName server_b -ScriptBlock {sqlcmd -S server_bsqlexpress -E -d ReleaseTeam -Q "exit(exec[dbo].[SP_NAME])"} -credential $cred
- Copy-Item "\server_asharenamefile.ext" "\server_bsharename"
- Copy-Item : The network path was not found.
- At line:1 char:10
- + Copy-Item <<<< "\server_asharenamefile.ext" "\server_bsharename"
- + CategoryInfo : NotSpecified: (:) [Copy-Item], IOException
- + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.CopyItemCommand
- server_a True on server_b
- server_a True on client
- server_b True on server_b
- server_b False on client
- Invoke-Command -ComputerName server_b -ScriptBlock {test-path -path "\server_asharenamefile.ext"} -credential $cred
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement