• Jeff Moden - Friday, March 9, 2018 2:13 PM

    goher2000 - Friday, March 9, 2018 1:31 PM

    you can probably avoid additional resources used by power-shell by simply mapping the drive on the destination server through tsql and restore the backup, you do not even need to copy file

    exec xp_cmdshell "net use x: \\sourceserver\backupdir /user:domain\user password"
    go
    restore database demodb from disk='x:\demodb.bak'
    go
    exec xp_cmdshell "net use x: /delete"
    go

    GOD NO!!!!   NEVER EVER PUT A PASSWORD IN CLEAR TEXT!!!!

    well you dont  have to if you give permission to service account of your destination server  on backup folder..