Change listener connetion error
“The Microsoft Dynamics NAV Server cannot connect the Change Listener to SQL Server because of the following error: user ‘NT AUTHORITY\NETWORK SERVICE’ failed when log in”.
This error may happen when you are attaching the database manually, or if database and NAV service is on two different machines. A variation of this may also happen if you setup NAV server to user domain user account. Luckily the solution is the same for all problems
Enabling the Object Change Listener
1. Open “SQL Server Management Studio” and then connect to your SQL Server instance.
2. On the File menu, point to New, and then click Query with Current Connection.
3. Type the following SQL statements.
USE MASTER CREATE LOGIN [ReplaceWithNAVServerAccount] FROM WINDOWS; GO
4. Highlight the lines that you typed and, on the Query menu, click Execute.
5. Now type these lines below the existing lines.
USE [ReplaceWithYourDatabaseName] CREATE USER [ReplaceWithNAVServerAccount] FOR LOGIN [ReplaceWithNAVServerAccount];
6. Highlight the lines that you just typed and, on the Query menu, click Execute.
7. Now type these lines below the existing lines.
CREATE SCHEMA [$ndo$navlistener] AUTHORIZATION [ReplaceWithNAVServerAccount]; GO
8. Highlight the lines that you just typed and, on the Query menu, click Execute.
It’s very possible that you will see an error stating that the schema in question already exists. This is not a problem.
9. Now type these lines below the existing lines.
ALTER USER [ReplaceWithNAVServerAccount] WITH DEFAULT_SCHEMA = [$ndo$navlistener]; GRANT SELECT ON [Object Tracking] TO [ReplaceWithNAVServerAccount]; GO
10. Highlight the lines that you just typed and, on the Query menu, click Execute.
This could probably be combined to a simple script.