I recently had to re-deploy an ADFS farm, and ran into the following error while finishing the ADFS configuration:
Unable to open the physical file: “C:\Windows\WID\Data\AdfsArtifactStore.mdf”. Operating system error 2: “2(The system cannot find the file specified.)”
Not only is the error a bit misleading, it also doesn’t give you any ideas on how to fix it – searching around on the web didn’t turn much up around that error (of course it didn’t), so I ran through the basic troubleshooting steps:
- Checked to verify that I have the right permissions / admin access: Check
- Reboot: Check
I was going to go down the route of downloading the SQL management tools, connecting to my WID and digging around to see if I could figure out what was broken – before I got to that, though, I figured I’d try resetting the WID and seeing if that resolved the problem. Thankfully, this turned out to be a simple solution, and only took a few minutes to complete.
NB: The only way I found to reset the WID was to uninstall / reinstall it – not a problem if this is a new server you’re configuring, or if you plan to overwrite the configuration anyway. Just don’t do this if you’re co-locating any other services that might be using the WID. You shouldn’t be, but still… this option DELETES THE WID ENTIRELY!
With that warning out of the way, let’s get to it:
Open Server Manager, click Manage, then Remove Roles and Features:
Uncheck the Windows Internal Database, and click Next:
Confirm your uninstalling the WID, and click Remove:
Finally, open Windows Explorer and go to C:\Windows\WID\Data – select all the files in this folder, and delete them:
** Remember I told you that you’re deleting your WID – don’t go through with this if you’ve got something else running on this server that might be using it! **
Go ahead and reboot the server and then go back into Server Manager, and this time choose Add Roles and Features, click through the starting selection pages, check the box beside the Windows Internal Database, click Next, then Install.
Once you’ve completed the install, go back and re-run your ADFS config, and Bob should most definitely be your Uncle:
(Since this is a secondary server being added to an existing farm, this warning is expected – all good!!)