We were fortunate to not have an issue for the wannacry ransomware. It was time to make sure this this never happened. We have a script designed to tell us when a system lacked the patching it needed.
While running it on one system; I received a rather peculiar error:
Win32_OperatingSystem class missing
I tried all the usual repairs and and tried to rebuild the WMI repository. Still the error persisted.
The following commands solved this issue:
cd %windir%\system32\wbem for /f %%s in ('dir /s /b *.mof *.mfl') do mofcomp %%s
Information came from the following Technet entry.