WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

14
WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium

Transcript of WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

Page 1: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

WMI For the System Center Configuration

manager 2007 Administrator

System CenterUser Group Belgium

Page 2: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

Agenda

Introduction WMI basics Troubleshoot WMI Extended WQL (WMI query language) WMI Tools WMI in ConfigMgr Advanced WMI in ConfigMgr SccmAutoDoc Q & A

Page 3: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

IntroductionWhat is WMI?

◦Wikipedia: “WMI is Microsoft's implementation of the Web-Based Enterprise Management (WBEM) and Common Information Model (CIM) standards from the Distributed Management Task Force (DMTF).

◦SMS 2.0 MOC: “WMI does for management software what printer drivers did for printing”

◦Me: “ The registry on steroids.”

Page 4: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

WMI basics (1)NamespacesClassesMethodsProperties

◦Embedded properties Props Proplists regmultistringlists

◦Lazy properties

Page 5: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

WMI basics (2) Providers

◦ regProv◦ regPropProv◦ Disk & CPU◦ View instance provider◦ AI Providers (aainstprov)◦ Write your own (

http://myitforum.com/cs2/blogs/rzander/archive/2009/03/30/wmi-provider-to-list-the-monitors-serialnr-and-model-name.aspx)

Events◦ SELECT * FROM __InstanceModificationEvent WITHIN 10 WHERE

TargetInstance ISA 'SMS_Collection' Qualifiers

◦ Dynamic◦ CimType

Page 6: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

Troubleshoot WMI Wmidiag Repair

◦ XP SP2+ rundll32 wbemupgd, UpgradeRepository

◦ Vista and above (Needs to be Run as administrator) winmgmt  /salvagerepository

◦ Windows server 2003 rundll32 wbemupgd, RepairWMISetup

Re-register wmi components◦ cd /d %windir%\system32\wbem ◦ for %i in (*.dll) do RegSvr32 -s %i ◦ for %i in (*.exe) do %i /RegServer

Rebuild repository as a last resort (Might kill other applications)◦ Net stop winmgmt

◦ Ren %windir%\System32\Wbem\Repository %windir%\System32\Wbem\Repository_Bad

◦ Net start winmgmt

Page 7: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

Extended WQLExtended Wql (http://msdn.microsoft.com/en-us/library/cc146121.aspx)

◦Select x from class◦Other keywords

Distinct, count, join, where, order by In / not in GetDate, datediff, dateadd http://

www.myitforum.com/articles/8/view.asp?id=10909SELECT DISTINCT SMS_MonthlyUsageSummary.ResourceIDFROM SMS_MonthlyUsageSummaryINNER JOIN SMS_MeteredFilesON SMS_MonthlyUsageSummary.FileID = SMS_MeteredFile.MeteredFileIDWHERE DateDiff(day,SMS_MonthlyUsageSummary.LastUsage, GetDate()) < 90AND SMS_MeteredFiles.RuleID = 6

Page 9: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

WMI in ConfigMgr (1)Omni-Present

◦SMS Provider / Administrator console◦Dynamic Collections◦Queries◦Hardware inventory◦ConfigMgr client settings store

Page 10: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

WMI in ConfigMgr (2) Namespaces used by Sccm

◦ Server side Root\sms (sms_providerlocation) Root\sms\site_sitecode

◦ Client side Root\ccm Root\ccm\invagt Root\ccm\policy

Sccm wmi Class structure◦ Abstract classes (Require sitecode='xyz')

Sms_sci Sms_siib

◦ Sms_r*◦ Sms_g*◦ Sms_cm_res_coll_collid

Page 11: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

Advanced WMI inConfiguratio ManagerLocal Policies

◦http://technet.microsoft.com/en-us/magazine/2006.09.customizesms.aspx

◦Examples Request permission for Remote Tools Custom Hardware Inventory Disable individual agents

[CCM_Policy_PartialPolicy(true)] instance of CCM_SoftwareDistributionClientConfig {SiteSettingsKey = 1; PolicySource = "Local"; // override only this property, all others from the Site/Management Point [CCM_Policy_Override(true)] Enabled = FALSE;};

Page 12: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

SccmAutoDocWhat is SccmAutodoc?

1. My source for getting to know WMI in ConfigMgr2. A program that, based on WMI queries

automatically documents your site settings Where can I get SccmAutodoc?

◦ SccmAutodoc 1.126 is currently in beta and can be downloaded from http://www.scug.be/media

Is SccmAutodoc freeware?◦ SccmAutodoc will become moderately priced

software once it leaves the beta stages, hopefully somewhere near the end of this year.

Page 13: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

Q & A

Page 14: WMI For the System Center Configuration manager 2007 Administrator System Center User Group Belgium.

Thank You

SCUG.be !