Cannot Backup to Network Share using Ola Hallengren’s Scripts
SQL Version: Microsoft SQL Server 2016(SP3)(KB5003279) – 13.0.6300.2 (X64)
OS Version: Windows Server 2012 R2 Standard
I am trying to setup the backups and database maintenance jobs using Ola Hallengren’s sripts. I have the following job setup:
sqlcmd -E -S $(ESCAPE_SQUOTE(SRVR)) -d master -Q "
EXECUTE dbo.DatabaseBackup
@Databases = 'Lease',
@Directory = N'\\wlsfs02\Shared05\DatabaseBackups',
@BackupType = 'FULL',
@Verify = 'Y',
@CleanupTime = 360,
@CleanupMode = 'AFTER_BACKUP',
@Compress = 'Y',
@ChangeBackupType= 'N',
@CheckSum = 'Y',
@LogToTable = 'Y'
" -b
When I run the job it errors out with:
The file path does exist and is correct. If I change the file path to a local drive it will run and successfully backup the database. The job is running as:
Looking at SQL Server Agent in SSCM it is using the Network Service account. If I try to change it to a domain account that has access to the network folder I get the following error:
I know for sure the password I provided was correct.
What am I doing wrong? How do I get the script above to backup to a network location?