I think that the audit information is corrupted or missing. What can I do?

Repair .NET Framework

Ensure that the version of the Microsoft .NET Framework installed on the endpoint is up to date and functional. Repair the installation if necessary. For instructions, refer to .NET Repair Tool in the Microsoft documentation

Run the Agent Health Check tool

Download the Agent Health Check tool PowerShell script and run it against the device in question. At the end of Page 2 you will receive a prompt asking if you want to attempt to fix the WMI:

There are three statuses for the WMI check that show up in parentheses after Attempt to fix the WMI?:

  • No issues detected: Repair is not recommended or necessary.
  • Potential issues detected: Repair is recommended if issues are identified.
  • Significant issues detected: Repair is strongly recommended.

The WMI repair process

If significant issues are detected – that is, issues reading common WMI data points like the device’s last boot time or its installed antivirus software (on workstations), the tool will run the following command:

winmgmt /salvagerepository

This is a Windows command which attempts to recover all usable data from the WMI and rebuild it into a new database.

The tool will always then perform these steps:

  • Ensure Windows Managed Object Format files are present to attempt to repair. If they are not there, the WMI may have been deleted outright. Refer to Rebuild the WMI Repository.
  • Recompile the MOF files which comprise the WMI.

Rebuild the WMI Repository

If the Agent Health Check tool was unable to repair the WMI, or if its contents are absent, the WMI repository will need to be rebuilt from scratch.

Proceed with caution and at your own risk. Before attempting this process, review the following warning from Microsoft:

IMPORTANT  If you suspect WMI or repository corruption, rebuilding the repository is the last thing you should do. Deleting and rebuilding the repository can cause damage to the system or to installed applications. Other steps should be taken first to eliminate other possibilities or to confirm you have repository corruption. An extremely large repository also creates problems and can sometimes be interpreted as a corrupt repository, which is not always the case. If issues are due to a large repository, rebuilding it is currently the only method available to reduce its size.

If this process fails to re-add any .MOF files, some installed programs on your endpoint may stop working and require reinstallation. Consider your options carefully before continuing.

To rebuild your WMI, run the following commands from an elevated command prompt on the affected endpoint:

Net stop Winmgmt
Winmgmt.exe /standalonehost
Winmgmt.exe /resetrepository
Net start Winmgmt