WMI Notes
I have spent too much time trying to fix WMI. Here are my notes. Sometimes nothing works and the only recourse is to rebuild the machine.
Step 1. DCOM permission
- Open Dcomcnfg
- Expand Component Service -> Computers -> My computer
- Go to the properties of My Computer
- Select the COM Security Tab
- Click on "Edit Limits" under Access Permissions, and ensure "Everyone" user group has "Local Access" and "Remote Access" permission.
- Click on the "Edit Limit" for the launch and activation permissions, and ensure "Everyone" user group has "Local Activation" and "Local Launch" permission.
- Highlight "DCOM Config" node, and right click "Windows Management and Instruments", and click Properties.
Step 2. Permission for the user to the WMI namespace
- Open WMImgmt.msc
- Go to the Properties of WMI Control
- Go to the Security Tab
- Select "Root" and open "Security"
- Ensure "Authenticated Users" has "Execute Methods", "Provider Right" and "Enable Account" right; ensure Administrators has all permission.
Step 3. Verify WMI Impersonation Rights
- Click Start, click Run, type gpedit.msc, and then clickOK.
- Under Local Computer Policy, expand Computer Configuration, and then expand Windows Settings.
- Expand Security Settings, expand Local Policies, and then click User Rights Assignment.
- Verify that the SERVICE account is specifically granted Impersonate a client after authentication rights.
WMI Repair - Windows XP
c:\windows\system32\rundll32.exe wbemupgd, UpgradeRepository
Windows Server 2003
c:\windows\system32\rundll32.exe wbemupgd, RepairWMISetup
Windows 2008 or Win 7
c:\windows\SysWOW64\wbem\winmgmt.exe /salvagerepository
Testing WMI
wbemtest
connect to root\cimv2
enter query select * from win32_operatingsystem
From powershell
gwmi win32_operatingsystem –computername nameofcomputer
WMI Repair - Windows 7 or Server 2008
Ensure that the Windows Management Instrumentation (WMI) service is running on this computer.
Ensure that the Remote Procedure Call (RPC) service is running on this computer.
Ensure that the WMI Repository is consistent on the computer
- Open a Command Prompt
- Run the following command: “winmgmt /verifyrepository”
- If the repository is not consistent, then run the command “winmgmt /salvagerepository”
Ensure that DCOM is enabled
- Run Dcomcnfg.exe
- Click the Component Services node under Console Root
- Open the Computers folder
- For the local computer, right-click My Computer, and then click Properties
- Type the computer name
- Right-click the computer name, and then click Properties
- Click the Default Properties tab
- Click to select (or click to clear) the “Enable Distributed COM on this Computer” check box
- If on turn off – apply – turn -- on apply
- Set Default Authentication Level to Connect
- Set Default Impersonation Level to Identify
To test:
On machine run wbemtest.ex e
Connect to root\cimv2
Entery query select * from win32_operatingsystem
Remote test
From powershell prompt
Gwmi win32_operatingsystem –computername nameofcomputer
WMI Repail - Server 2003
Ensure that the Windows Management Instrumentation (WMI) service is running on this computer.
Ensure that the Remote Procedure Call (RPC) service is running on this computer.
Ensure that the WMI Repository is consistent on the computer
- Open a Command Prompt
- Run the following command: “c:\windows\system32\rundll32.exe wbemupgd, RepairWMISetup”
- Ensure that DCOM is enabled
- Run Dcomcnfg.exe
- Click the Component Services node under Console Root
- Open the Computers folder
- For the local computer, right-click My Computer, and then click Properties
- Type the computer name
- Right-click the computer name, and then click Properties
- Click the Default Properties tab
- Click to select (or click to clear) the “Enable Distributed COM on this Computer” check box
- If on turn off – apply – turn -- on apply
- Set Default Authentication Level to Connect
- Set Default Impersonation Level to Identify
To test:
On machine run wbemtest.exe
Connect to root\cimv2
Entery query select * from win32_operatingsystem
Remote test
From powershell prompt
Gwmi win32_operatingsystem –computername nameofcomputer