I created a remote backup device with no problem using the following script.
EXEC sp_addumpdevice 'disk', 'networkdevice',
however, when I tried to run the following backup script I am getting the error below.
BACKUP DATABASE AdventureWorks2012
TO DISK = '\\SQLSERVER2\REMOTESQLBAKUPS\AdventureWorks2012.bak';
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device '\\SQLSERVER2\REMOTESQLBAKUPS\AdventureWorks2012.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
When I map to this shared folder from the source SQLSERVER1 to the target (\\SQLSERVER2\REMOTESQLBAKUPS) I am able to copy and create files with no problems.
I made sure that the shared folder on \\SQLSERVER2\REMOTESQLBAKUPS is using the same domain account (DOMAIN\ACCOUNT) with full permissions. So both SQLSERVER1 and SQLSERVER2 SQL server agent are both using the same account as well.
What am I doing wrong?