Thursday, March 18, 2010

Shutdown computer on command line

shutdown -i

Rebuild WMI database

Originated from SCCM client's error:
Setup was unable to create the WMI namespace CCM The error code is 80041002

There are several ways to clean/rebuilt WMI.
A) Simple rebuilt of WMI repository
This is the short version...
1. stop WMI service-> look up the command for that
2. rename the Repository subdirectory in %windir%\system32\wbem
3. rebuilt the WMI Repository in:
starting wbemtest.exe
connecting using Root/Default
The first connection will take some time since the repository is being rebuilt, but you should connect to a brand new repository afterwards

Additional info:
http://www.microsoft.com/technet/scriptcenter/topics/help/wmi.mspx


B) Complete reinstall of WMI
The steps generally include the following:
1. winmgmt /clearadap
2. winmgmt /kill
3. winmgmt /unregserver
4. winmgmt /regserver
5. winmgmt /resyncperf
6. net stop winmgmt
7. del %SystemRoot%/system32/Wbem/Repository/*.* /s
8. net start winmgmt
9. %SystemRoot%/system32/wbem/wbemtest.exe