To anyone who has the same problem and isn't the most computer savvy, try the steps below. I've tried every other suggestion and nothing has worked, so I turned to ChatGPT for some help (as a last straw because it usually ends up frustrating me more with all the additional errors that arise with code from there), and it actually worked! Just opened the command prompt and typed out the code and tried the install again. Hope this helps.
- Open an Elevated Command Prompt:
- Right-click on the Start button (or press
Win + X
) and select "Command Prompt (Admin)" or "Windows Terminal (Admin)" to open Command Prompt with administrative privileges.
- Change Directory to WMI Folder:
- In the Command Prompt window, type the following command and press Enter:
cd
This command changes the current directory to the WMI folder where the necessary files are located.
- Grant Permissions to WMI Namespace:
- After changing to the correct directory, run the following command to grant the current user account permissions to the WMI namespace:
for
This command compiles all .mof and .mfl files in the directory, which effectively grants the necessary permissions to interact with the WMI repository.
- Salvage and Reset WMI Repository:
If successful, follow up with resetting the WMI repository:
winmgmt /resetrepository
- Verify and Continue Installation:
Ensure that there are no more access denied errors.
- Proceed with SQL Server Installation:
- Once the WMI repository issue is resolved, attempt to install SQL Server 2022 Express Edition again. Hopefully, the "Invalid class" error during installation should no longer occur.