Thursday, 18 August 2022

Microsoft Azure AD Sync service stuck starting

Seen an issue with the Azure AD Sync service stuck starting,  If you check the event log > Application logs you may see an issue with Event ID:528 Source SQLLocalDB.

If you are seeing this it could be the Sync DB has become damaged.  Disable the "Microsoft Azure AD Sync" Server and kill of its pid or reboot the server.

Now depending who the server is running as the logs and DB could be in 1 of too places.

Running as System > C:\Windows\ServiceProfiles\ADSync\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances
Running as AAD_<NUMBER> > C:\Users\AAD_<NUMBER>\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\

Step one would be to check the logs and look for the following error

‘model’ is not valid

If your getting this then its damaged and needs to be replaced.  the logs are located in:

ADSync2019/error.log

You need to take a copy of the following files from C:\Program Files\Microsoft SQL Server\150\LocalDB\Binn\Templates:

model.mdf
modellog.ldf

and place them in:

ADSync2019/

I would rename the old ones and copy in these once form there,  set the service back to automatic and start it back up, may take a min but should switching to running.

Then open AD Sync and confirm its doing the syncs again

1 comment:

  1. Very useful article! Helped me solve my issue. Thank-you.

    ReplyDelete