I am having a problem backing up the database to the network path using dbatools.io Backup-DBAdatabase command.
This is a workgroup environment. The SQL Server runs under the NT Service\MSSQLSERVER account. The location I am trying to backup is a standalone NAS drive.
I mapped the network folder to the SQL Server machine but when I backup to that drive it fails with
WARNING: [14:25:08][Backup-DbaDatabase] Backup Failed | System.Data.SqlClient.SqlError: Cannot open backup device 'K:\BackupTest\15Jan2021_12_34\full\sdsd_180_infras_b18c6_202101151425.bak'. Operating system error 3(The system cannot find the path specified.).
If I use the UNC path I get
WARNING: [14:24:04][Backup-DbaDatabase] Backup Failed | System.Data.SqlClient.SqlError: Cannot open backup device '\\XX.XX.XX.XX\backup\BackupTest\15Jan2021_12_34\full\XX_180_infras_b18c6_202101151424.bak'. Operating system error 1326(The user name or password is incorrect.).
I am aware the issue is due to the SQL Service account's lack of permission on the NAS folder not sure how can resolve it.
I really appreciate your help