AX2012 R2 Database Synchronization Error – Failed to create a session

While testing some system configuration switches I had to re-synchronize the database a number of times. When I first synchronized the system I received the following error:

Failed to create a session; Confirm that the user has the proper privileges to log on to Microsoft Dynamics.

This issue occurred on a demo database and was caused because there was multiple partitions on the environment. Each partition has it’s own admin user, but only the primary partition admin account was pointing correctly to the correct domain and SID.

Using the following SQL I was able to change the admin accounts for the other partitions to bring them into alignment with primary partition.

DECLARE @Domain nvarchar(255);
DECLARE @Alias nvarchar(80);
DECLARE @SID nvarchar(124);
DECLARE @Partition BIGINT;

SELECT @Partition = Recid FROM PARTITIONS
WHERE PARTITIONKEY = N’Initial’

SELECT @Alias = NETWORKALIAS, @Domain = NETWORKDOMAIN, @SID = SID FROM USERINFO
WHERE PARTITION = @Partition AND ID = N’Admin’

UPDATE USERINFO SET NETWORKDOMAIN=@Domain, NETWORKALIAS=@Alias,SID = @SID
WHERE PARTITION != @Partition AND ID = N’Admin’

This issue should only occur if you are running multiple partitions in your environment.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s