Showing posts with label WMI. Show all posts
Showing posts with label WMI. Show all posts

Tuesday, April 22, 2014

SCCM Actions via WMI


Using WMIC to trigger SCCM Client Actions from command line:

Request for policy:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000021}" /NOINTERACTIVE

To Evaluate policy:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000022}" /NOINTERACTIVE

Disable Software-Distribution:
WMIC /namespace:\\root\ccm\policy\machine\requestedconfig path ccm_SoftwareDistributionClientConfig CREATE ComponentName="Disable SWDist",Enabled="false",LockSettings="TRUE",PolicySource="local",PolicyVersion="1.0" ,SiteSettingsKey="1" /NOINTERACTIVE

Re-Activate Software-Distribution:
WMIC /namespace:\\root\ccm\policy\machine\requestedconfig path ccm_SoftwareDistributionClientConfig WHERE ComponentName="Disable SWDist" delete /NOINTERACTIVE

Trigger Hardware Inventory:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000001}" /NOINTERACTIVE

Trigger Software Inventory:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000002}" /NOINTERACTIVE

Trigger DataDiscoverRecord (DDR) update:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000003}" /NOINTERACTIVE

Force a FULL HW Inventory on next HW-Inv Schedule:
WMIC /namespace:\\root\ccm\invagt path inventoryActionStatus where InventoryActionID="{00000000-0000-0000-0000-000000000001}" DELETE /NOINTERACTIVE

Repair SMS/SCCM Agent on a remote client:
WMIC /node:%MACHINE% /namespace:\\root\ccm path sms_client CALL RepairClient

Repair a list (all clients listed in clients.txt) of remote SCCM Agents:
WMIC /node:@clients.txt /namespace:\\root\ccm path sms_client CALL RepairClient

Thursday, September 26, 2013

Fix: WMI repository reset failed

Fixing WMI issues can be quite a pain as we all know :)
There is another WMI issue which I have encountered recently on Windows 7 and fixed which I thought
should be shared with all.

Usually for WMI issues in Windows 7, the last resort to resolve the issue would be to reset the
repository using winmgmt /resetrepository

But what if even this last resort fails you?
The error that I have gotten attempting to fix this client is as below

C:\Users\vincent.goh.adm>Winmgmt /resetrepository
WMI repository reset failed
Error code:     0x8007041B
Facility:       Win32
Description:    A stop control has been sent to a service that other running ser
vices are dependent on.

To resolve this, you can follow the below procedure

1)      Adding Network service to Local Administrator
2)    Navigate to the key below and confirm if the Value is "Both". If its is not, go ahead to change it to Both
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F3130CDB-AA52-4C3A-AB32-85FFC23AF9C1}\InprocServer32\ThreadingModel]

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F3130CDB-AA52-4C3A-AB32-85FFC23AF9C1}\InprocServer32
Value Name: ThreadingModel
Value Type: REG_SZ
Correct Value Data: Both
 3)      Then restart the WMI services in services.msc.

Monday, September 10, 2012

Suggested WMI Hotfixes

Microsoft has released a fast publish article to address the numerous WMI issues that has been reported.
WMI issues will have high level symptoms as below and for me, the concerns are towards SCOM and SCCM

  • Loss of functionality with enterprise management/monitoring software for various machines. Software examples: Microsoft SCOM/SMS etc
  • Loss of functionality related to Citrix terminal services load-balancing.
  • Loss of functionality for WMI-based scripts.
  • Slow user logon times on Citrix terminal servers.
  • Slow user logon times on Windows clients where WMI-based group policy filters are in-place

The article is as below
http://support.microsoft.com/kb/2591403/en-us?sd=rss&spid=12925