Backup-SqlDatabase backupfile location reference

%3CLINGO-SUB%20id%3D%22lingo-sub-2265982%22%20slang%3D%22en-US%22%3EBackup-SqlDatabase%20backupfile%20location%20reference%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2265982%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20two%20sql%20servers%20and%20I%20have%20been%20running%20a%20powershell%20script%20on%20each%20for%20the%20daily%20full%20backup.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20looking%20at%20perhaps%20backing%20them%20up%20using%20a%20single%20script%20from%20a%203rd%20server.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20current%20scripts%20backup%20the%20databases%20to%20another%20drive%20on%20each%20sql%20server%20(for%20easy%20access%20refreshing%20test%20systems)%20then%20copies%20them%20to%20another%20server%20offsite.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20question%20I%20have%20is%20regarding%20the%20backup-sqldatabase%20command.%26nbsp%3B%20Is%20the%20backupfile%20parameter%20referenced%20from%20the%20computer%20running%20the%20script%20or%20from%20the%20Server%20running%20sql%3F%26nbsp%3B%20If%20I%20specify%20E%3A%5CBackup%5Cfile.bak%20will%20that%20be%20E%3A%20on%20the%20server%20running%20the%20script%20or%20on%20the%20SQL%20Server%20being%20backed%20up%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2265982%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESQL%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hi all,

 

We have two sql servers and I have been running a powershell script on each for the daily full backup.

 

I was looking at perhaps backing them up using a single script from a 3rd server.

 

The current scripts backup the databases to another drive on each sql server (for easy access refreshing test systems) then copies them to another server offsite.

 

The question I have is regarding the backup-sqldatabase command.  Is the backupfile parameter referenced from the computer running the script or from the Server running sql?  If I specify E:\Backup\file.bak will that be E: on the server running the script or on the SQL Server being backed up?

 

thanks

1 Reply
Not totally sure, but based on what I read on Microsoft Documentation
https://docs.microsoft.com/en-us/powershell/module/sqlserver/backup-sqldatabase?view=sqlserver-ps
its says
'the backups are stored in the default backup location of the server under the name databasename.bak for full and file backups, or databasename.trn for log backups.'
So it seems its using the server