In a post earlier today on a DirSync export not synching, I highlighted the need to reinstall DirSync because of a bad version. In the process of doing this though, I had to wade through a bunch of frustrating problems. While upgrading, I wound up having errors that I couldn’t recover from no matter how hard I tried. Instead, I had to remove and reinstall. However that process didn’t work well either. After completely uninstalling, I tried reinstalling and ran into several errors including, but not limited to, the following:
[callout] The install was unable to setup a required component. Check the event logs for more information. Please try the installation again, and if this error persists, contact Technical Support.[/callout] There were various iterations of this message as I installed and uninstalled several times. If you’re having this problem, or similar problems, here is what I did to fix it:
- Uninstall Windows Azure Active Directory Sync tool and reboot
- Remove all remaining files located in C:\Program Files\Windows Azure Active Directory Sync and the directory itself
- Edit the local users and groups and remove the user account setup for the purpose of synchronization
- Delete the Group accounts that are created as well
- This is probably the most important step and could possibly be the only step you really need, though I wasn’t able to test that to be sure. Delete the old database files located at C:\Program Files\Microsoft SQL Server\MSSQL11.MSONLINE\MSSQL\DATA
- FIMSynchronizationService.mdf
- FIMSynchronizationService_log.ldf
- Additionally, if these are the only database files on the server, you can delete all contents of the Data folder
- Note: I believe this last step was really the secret sauce. After doing the other steps, I went back in the Event Logs, which fill up with quite a bit of information, and found the following error messages
- Cannot create file ‘C:\Program Files\Microsoft SQL Server\MSSQL11.MSONLINE\MSSQL\DATA\FIMSynchronizationService.mdf’ because it already exists. Change the file path or the file name, and retry the operation.
- Login failed for user ‘DOMAIN\user’. Reason: Failed to open the explicitly specified database ‘FIMSynchronizationService’. [CLIENT: <local machine>]
- Product: Forefront Identity Manager Synchronization Service — Error 25009.The Forefront Identity Manager Synchronization Service setup wizard cannot configure the specified database. CREATE DATABASE failed. Some file names listed could not be created. Check related errors.Cannot create file ‘C:\Program Files\Microsoft SQL Server\MSSQL11.MSONLINE\MSSQL\DATA\FIMSynchronizationService.mdf’ because it already exists. Change the file path or the file name, and retry the operation. <hr=0x8023044a>
After this final step, you can reinstall DirSync, and you should see the following page and breathe a sigh of relief. Figuring this out too me far longer than I’d like to admit, but it needed to be done. If it helped you move past your frustration, let me know with a comment. Thanks!
Thank you!
Deleting the old databases fixed it for me.
Awesome! Always good to have someone commend so I know I am not the only person who has had the problem. Glad to have been of service.
C:\Program Files\Windows Azure Active Directory Sync
and run the unistall tool – this will clean it all up for you and allow a reinstall
Nice. Thanks for contributing! Hopefully that will help someone solve their problem.
thanks for such an excellent post..
My pleasure.
This just alleviated so much frustration.
Much thanks for this! I was about to give up and burn and incident when I found your post. Your well-written instructions and screen shots did the trick. DIRSYNC is re-installed and working.
Glad to see someone else saved from madness. Onward to other things!
Thank You very much this saved me a lot of time. Only one note if Dirsync is installed on a DC as now supported then the users and groups you mentioned should be deleted from the AD domain.
Thanks again,
David
David, thanks for the additional tip. I’m sure people will find it helpful.
Deleting the databases worked for me also. Thanks for the insight Joseph.
Hello.
My problem is a little bit different. The VM containing Dirsync installation is gone. I need to install Dirsync on another computer now but don’t know what would need to be removed from AD and online server before doing that. Any recommendations? Thanks.
Jose, this may not be what you’re looking for, but in my experience, I as long as the VM with the databases and dirsync on them were removed, and the install of DirSync happened on a new or different VM, it shouldn’t be a problem. When you try to install elsewhere, do you have issues?
I have not tried to install on the other VM yet. I wanted to be sure that I would not be running into any problem by doing that. I contacted Microsoft Technical support and they say I will not have any issues by installing on another computer. Thank you very much for your reply, Mr. Turley. I appreciate it.
Cool. Glad to know Microsoft and I were on the same page! Good luck with DirSync. It’s a blessing and a curse.
Thank you very Much, I have removed only the FIM databases that were on this folder
C:\Program Files\Microsoft SQL Server\MSSQL11.MSONLINE\MSSQL\DATA
This fix worked for me. Removing the database files was the key.
Thanks for sharing!
Here following up with your step to delete everything from “C:\Program Files\Windows Azure Active Directory Sync” messed up things pretty badly. I couldn’t get the installer going anymore.
I copied all files back in from another DirSync server and instead just ran UnInstallDirectorySync.exe from this same folder. That allowed me to reinstall DirSync without any trouble. No need to do anything else or remove files/users/groups.
That’s interesting. If the uninstaller works for you, then I can see how that would be problematic. 🙂 If it doesn’t work for you however, clearing it out would make sense. Thanks for bringing up a good point.
I ran into a similar issue that Koen described. However, the steps below were easier for me than finding another dirsync server zipping the 185MB folder and copying it to the other server:
Expand the following registry sub key: HKEY_LOCAL_MACHINE/ Software/ Microsoft/ Windows/ CurrentVersion/ Uninstall.
Find the GUID entry that has the dirsync info and then run the following command from a command prompt:
MsiExec.exe /x {GUID} /lvx DirSync_Uninstall.log
More information can be found here: https://community.office365.com/en-us/f/613/t/261834. The guy talks about specific GUIDs in the uninstall key but I had neither of those. Search for the one that has the directory synchronization info; there should only be one.
Thank you Mr. Turley for posting the help. If only technet were so detailed.
Thanks for this. This was my issue as well. Spent a whole Sunday morning trying to get this going. You saved my Sunday afternoon!
Awesome! I love dirsync but what a mess if something goes wrong or if you change direction and then have to change it back.
Glad you found it helpful!
Thanks Joseph for posting this valuable information. I ran into the problem you’re describing in this article and tried your suggested solution and it worked like a charm. It made my life easier. 🙂
Genius! Took me 3 hours to find your post but I’m glad I eventually did.
I wonder if there are any other steps to try to fix this problem. I uninstalled DirSync and Windows Azure DirSync (or something like that), I deleted the “C:\Program Files\Windows Azure Active Directory Sync” directory, I uninstalled Forefront Identity Manager (though I got error messages when doing so because it could not find the FIMS database), I deleted the AAAD and FIMS users and groups from AD. But I’m still unable to reinstall DirSync. Am I missing something?!
Thank you for having this information. It proved invaluable for me in setting up my test environment. It was the deletion of the mdf & ldf file that got me past the error
Many thanks
The deletion of two files helped my on-going issue. Thanks.
Many thanks. The deletion of the mdf and ldf file was what resolved my issue.
Mike
Many thanks….its working now.
Thanks! Great article, solved my problems!
I’ve done the steps above, but no avail. I’ve uninstalled everything Azure related (sign in assistant, powershell module etc.), but need to keep SQL Express for another database. It seems like the install is failing when trying to install advanced components or something: Detection of product ‘{A7037EB2-F953-4B12-B843-195F4D988DA1}’, feature ‘SQL_SSMS_Adv’, component ‘{E5CB3372-306D-4879-B27B-AF83B1A4921E}’ failed. The resource ‘f:\’ does not exist.
Thanks a lot Joseph, removing the databases was all I had to do, fixed my problem. Keep up the good work!
Thanks for sharing! its working now:D
Many thanks for this solution. This saved my day!
You saved me a lot of grief and hair pulling…Thank you!
thank you for these clear directions! they worked for me (and I didn’t have to reboot the domain controller server that this application is installed on either)
Thanks, I rename the C: \Program Files\Microsoft SQL Server\ MSSQL11.MSONLINE and run the installer again and the problem was solved
You are a beautiful man. Thank you for sharing! Deleting the old database files worked for me.
Thank you for this post. You saved me hours of work. I tried the final step of just removing the old database but it did not work for me. I had to follow all the steps to fix issue.
another thank you – this fixed my issue
The unistall tool worked like a charm. Thanks for the post.