This can be seen in the error.log file under C:\Users\ADSyncMSAxxxx$\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\ADSync2019. Does this mean I just have to be very patient or is there still some involvement required?
Azure AD Connect Invalid class
Hi,
A couple of days ago the VM was hard rebooted a few times due to technical issues in the data center. There seemed to be no issues with the VM itself, but yesterday I got a message that Azure AD Connect (Entra Connect) is not working. Looking at the services, I see that the Sync and Health Agent services cannot start. Trying to open AD Connect itself throws a weird "Invalid class" error.
Analyzing the audit logs, I came across several strange errors. It seems to me that something is wrong with the .NET Framework, but I can't really understand the root of the problem.
I tried to repair Azure AD Connect. I tried to fix the situation with SFC and DISM commands, but nothing.
AD Connect version 2.3.8.0 runs on Windows Server 2022 with all updates. I hope for advice and help.
Thanks!
4 answers
Sort by: Most helpful
-
Tomass Pētersons 336 Reputation points
2024-07-05T16:49:49.3866667+00:00 -
Akhilesh Vallamkonda 9,850 Reputation points Microsoft Vendor
2024-07-08T13:54:17.63+00:00 Thank you for reaching us!
The "Invalid class" error you are seeing when trying to open AD Connect is typically caused by a corrupted WMI repository
sometimes simple restart might fix your issue, if still the issue is not fix, try Starting and stopping WMI service if the issue persists same rebuilding the WMI repository on the server where Entra Connect is installed.Hope this helps. please let me know if you any further queries.
Thanks,
Akhilesh.
If this answers your query, do click
Accept Answer
andYes
for was this answer helpful. And, if you have any further query do let us know. -
Tomass Pētersons 336 Reputation points
2024-07-13T15:48:06.5066667+00:00 In the end, the problem was really with the WMI classes. When I opened wmimgmt.msc, WMI Control properties showed the following errors -
Failed to initialize all required WMI classes.
Win32_Processor: WMI: Invalid class
Win32 WMISettmg WMI Invalid class
Security information Successful
Win32_OperatingSystem WMI Invalid class
So thanks Akhilesh for the hint to find the root of the problem.But to solve the problem, I didn't take drastic steps because I had heard that you need to be very careful with WMI classes. For example here is one article -
https://techcommunity.microsoft.com/t5/ask-the-performance-team/wmi-repository-corruption-or-not/ba-p/375484
Searching more specifically for errors in my case, I came across this -
https://techcommunity.microsoft.com/t5/ask-the-performance-team/wmi-missing-or-failing-wmi-providers-or-invalid-wmi-class/ba-p/375485However, as it was already very late, there was no time to spend more time, so I executed the following commands from the Command Prompt side, because somewhere I found a discussion where someone said that it helped in a similar problem -
cd C:\Windows\system32\wbem for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s for %i in (*.dll) do regSvr32 -s %i net stop winmgmt /y net start winmgmt gpupdate /force
Initially, it solved the problem, but immediately I noticed other oddities, for example, Server Manager could not be refreshed, throwing the following error -
Server Manager problem: Online - Data retrieval failures occurred
Digging around a bit more, I ended up running these commands from the command prompt -cd C:\Windows\system32\wbem\AutoRecover for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s
It basically restored all the WMI classes. I haven't noticed any more problems and Azure AD Connect is working again.
-
Akhilesh Vallamkonda 9,850 Reputation points Microsoft Vendor
2024-07-15T06:32:02.8+00:00 Hi @Tomass PētersonsI'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.
Issue:> Azure AD Connect Invalid class error
Solution:
you have fixed the issue by running the below commands from the command prompt
cd C:\Windows\system32\wbem\AutoRecover
for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s
it restored all the WMI classes and Entra ID connect is working without any issues.
If you have any other questions or are still running into more issues, please let me know. Thank you again for your time and patience throughout this issue.
Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.