How do I use a different domain and username in a SQL Server BACKUP LOG command? I looked here,


https://docs.microsoft.com/en-us/sql/t-sql/statements/backup-transact-sql?view=sql-server-2017#security


I want to backup my log to a different server.  When I do this through the SSMS, I get access denied because my SQLServer Service user is not what the other machine expects, and I did not want to run the MSSQLServer service with a special domain account.

I tried a share that has everyone for SMB and NTFS, but it did not help.

How can I run the BACKUP LOG command to my mapped drive with a specific username and password that does have permissions?

I considered Powershell's SQL Server cmdlet, but I am on SQL Server 2012 and am unsure if the new PS libraries will corrupt anything.


https://docs.microsoft.com/en-us/sql/powershell/download-sql-server-ps-module?view=sql-server-2017


I tried import-module SqlServer on the server, but it is not found.
Powershell won't help, it is just a wrapper for the BACKUP command. Your problem is that it is indeed the database engine that produces the backup file, and there is no option for impersonation here. So, you really need to sort out that service account, I'm afraid.

(There used to be something called a nullsession-share. I doubt it still exists, and basically you open that share to the whole world. Not recommended, I'm just mentioning here to recommend against it.)

Come to think of it, how about the computer account? I'm not sure if that will help, but if you grant privileges to that share for the computer account where your SQL Server is?