Advertisement
Guest User

Untitled

a guest
Jan 18th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. $username = userdomainusername
  2. $password = cat C:securestring.txt | convertto-securestring
  3. $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
  4. Invoke-Command -ComputerName server_b -ScriptBlock {sqlcmd -S server_bsqlexpress -E -d ReleaseTeam -Q "exit(exec[dbo].[SP_NAME])"} -credential $cred
  5.  
  6. Copy-Item "\server_asharenamefile.ext" "\server_bsharename"
  7.  
  8. Copy-Item : The network path was not found.
  9. At line:1 char:10
  10. + Copy-Item <<<< "\server_asharenamefile.ext" "\server_bsharename"
  11. + CategoryInfo : NotSpecified: (:) [Copy-Item], IOException
  12. + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.CopyItemCommand
  13.  
  14. server_a True on server_b
  15. server_a True on client
  16. server_b True on server_b
  17. server_b False on client
  18.  
  19. Invoke-Command -ComputerName server_b -ScriptBlock {test-path -path "\server_asharenamefile.ext"} -credential $cred
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement