Event ID 4003
"The Citrix Independent Management Architecture service is exiting. The XenApp Server Configuration tool has not been run on this server."
I found this CTX article about it, but nothing of it was applicable.
I did procmon traces and I found the following registry keys were missing on the bad system:
A broken system missing the Status Registry key
A working system with the Status key. Note Joined is "0"
After adding the Status Registry key:
===================================
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\IMA\Status]
"EnhancedDesktopExperienceConfigured"=dword:00000001
"Provisioned"=dword:00000001
"Ready"=dword:00000001
"Joined"=dword:00000000
===================================
I tried restarting the service and the progress bar got further but then still quit. Procmon showed me this:
That is ACCESS DENIED when trying to see that registry key. It turns out that the IMAService does not have appropriate permissions to read this key. The Magic Permissions on a working box and what you need to set here looks like this:
Notice that none of the permissions are inherited and "NETWORK SERVICE" is added with full control to this key. Now when we try and start the Citrix Independent Management Architecture service we get the following errors:
eventid 3989:
Citrix XenApp failed to connect to the Data Store. ODBC error while connecting to the database: S1000 -> General error: Invalid file dsn ''
eventid 3636:
The server running Citrix XenApp failed to connect to the data store. An unknown failure occurred while connecting to the database. Error: IMA_RESULT_FAILURE Indirect: 0 Server: DSN file:
eventid 3615
The server running Citrix XenApp failed to connect to the Data Store. Error - IMA_RESULT_FAILURE An unknown failure occurred while connecting to the database.
eventid 3609
Failed to load plugin C:\Program Files (x86)\Citrix\System32\Citrix\IMA\SubSystems\ImaWorkerGroupSs.dll with error IMA_RESULT_FAILURE
eventid 3601
Failed to load initial plugins with error IMA_RESULT_FAILURE
To correct these errors the local host cache needs to be rebuilt. To fix that we need to run:
Dsmaint recreatelhc
Dsmaint recreaterade
After doing that, we can start the IMA Service and MFCOM. If instead of IMA Service starting you get the following error message:
Eventid 4007
The Citrix Independent Management Architecture (IMA) service is exiting. The DSN File could not be updated with the information retrieved from Group Policy. Error: 80000001h DSN file: mf20.dsn DSN Entry: DATABASE Policy Setting: CTXDS Confirm that the Network Service has write permissions to the DSN File.
Ensure the following registry is populated:
reg add HKEY_LOCAL_MACHINE\PE_SOFTWARE\Wow6432Node\Citrix\IMA
/v DataSourceName /t REG_SZ /d "C:\Program Files (x86)\Citrix\Independent Management Architecture\mf20.dsn"