Problem description
When you use Server Manager to Add roles and features in Windows Server, the process hangs. The UI continuously displays the "Server Manager is collecting inventory data" message, preventing you from proceeding.
Cause
Server Manager uses the Windows Management Instrumentation (WMI) service to query and collect server configuration information. This issue occurs when the WMI service malfunctions or when its core database, the WMI repository, becomes corrupted.
Solution
To fix this issue, rebuild the WMI repository. This procedure repairs the WMI service, allowing Server Manager to collect inventory data correctly.
This procedure involves rebuilding a core system component. To back up your data, create a snapshot for your Elastic Compute Server (ECS) instance.
Log on to the ECS instance.
Go to ECS console - Instance. In the top navigation bar, select the target region and resource group.
Go to the details page of the target instance, click Connect, and select Workbench. Set the connection method to Terminal, enter the username and password, and then log on to the graphical terminal page.
Open Command Prompt as administrator.
Click Start, type
cmd, right-click Command Prompt, and then select Run as administrator.Repair the WMI service.
To prevent the WMI service from restarting or being accessed by other applications during the repair process, stop and disable the service.
sc config winmgmt start= disabled net stop winmgmt /yBack up the WMI repository files.
cd %windir%\system32\wbem ren repository repository-backupRe-register all WMI-related dynamic-link library (DLL) files.
for /f %s in ('dir /b *.dll') do regsvr32 /s %sChange the WMI service startup type to Automatic and then start the service.
sc config winmgmt start= Auto net start winmgmtRecompile all MOF and MFL files that are not marked for uninstallation and load them into the newly created WMI repository.
dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %s in (moflist.txt) do mofcomp %s
Restart the instance. Verify that the Add roles and features works as expected.