Skip to content

Instantly share code, notes, and snippets.

@JekRock
Last active September 3, 2017 18:10
Show Gist options
  • Save JekRock/3cfbc3902acdc9267ff5b84104f7f4f6 to your computer and use it in GitHub Desktop.
Save JekRock/3cfbc3902acdc9267ff5b84104f7f4f6 to your computer and use it in GitHub Desktop.
Copy files to shared folder with credentials
#Get local credentials
$mycredentials = Get-Credential
#Create credentials object
$secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ("username", $secpasswd)
Start-BitsTransfer -DisplayName MyJob -Credential $mycreds -Source "http://server01/servertestdir/testfile1.txt" -Destination "c:\clienttestdir\testfile1.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment