Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 SMS_DEF.MOF Editing Basics Oren Zippori Professional Services Team Computers & Systems Israel System Management User Group.

Similar presentations


Presentation on theme: "1 SMS_DEF.MOF Editing Basics Oren Zippori Professional Services Team Computers & Systems Israel System Management User Group."— Presentation transcript:

1 1 SMS_DEF.MOF Editing Basics Oren Zippori Professional Services Team Computers & Systems ISMUG@Team.co.il Israel System Management User Group

2 2 Meeting Agenda WMI and the MOF File. How to look at the MOF File. Editing the MOF File. Deploying the MOF File in SMS. How to Clean Up. KB Articles & Links.

3 3 WMI and the MOF File. WMI is MS Implementation of WBEM. Repository for a Wide range of Information. Helps in Managing Local and remote Machines. The Engine behind SMS Hardware Inventory.

4 4 WMI and the MOF File. When Ever SMS is install on a Computer the SMS_DEF.MOF File is Compiled. New Class are created in Root\CIMV2\SMS When Hardware inventory runs it checks the above Namespace to determine What class to report to the SMS server.

5 5 WMI and the MOF File. MOF File is Used to Write to WMI. –We Can Add new Data Class. –We Can Add new Report Class for SMS. The SMS_DEF.Mof is located: –On the SMS site server. –On Every CAP Server. –In 2 Places on the Client Machine.

6 6 How to look at the MOF File. MOF file is a ASCII base file. Open with Notepad. The SMS_DEF.Mof is build out of 3 parts: –Provider. –Data Class. –Reporting Class. A MOF file is Compile from Top to Bottom. SMS_DEF.MOF

7 7 How to look at the MOF File. NameSpace – A location in WMI Hierarchy. #pragma namespace("\\\\.\\root\\cimv2") #pragma namespace("\\\\.\\root\\cimv2\\SMS“) ROOT Class CIMV2 SMS CIM_Service Win32_BaseService Win32_service WMI

8 8 How to look at the MOF File. Provider – The Method in Which WMI Extracts its Information. There about 54 Default Providers In WMI We will talk about 2 Providers: –RPP – Registry Property Provider. –RIP = Registry Instance Provider

9 9 How to look at the MOF File. Data Class – The Method in Which WMI Extracts its Information. Data Class is Define in : Root\CIMV2\NameSpace Reporting Class – Tells SMS Hardware Inventory Agents what to collect From the WMI NameSpace. Reporting Class is always Define in Root\CIMV2\SMS NameSpace. Reporting Class is always Define in Root\CIMV2\SMS NameSpace.

10 10 How to look at the MOF File. Properties – Sub Components for the Class, they Define the Characteristics that can be Found In a Class. WIN32_Service Class Description Properties DisplayName Properties State Properties SMS_DEF.MOF

11 11 How to look at the MOF File. Instance – Will be the Object that are represented by the Class and its Properties. –For Example An Instance of the Win32_process Class would be presented by: its Name, Its Description, and its EXE File.

12 12 Editing the MOF File. Use NotePad.exe. MOF Manager, MofMan.exe. MofMan.exe Changing the Statues from FALSE to TRUE on Class and Instance. Do it the Easy way and Cut and Past From the Master MOF File. Do it the Easy way and Cut and Past From the Master MOF File. All Ways Use Comments and Document your Changes. Backup Backup Backup

13 13 5 Ways to customize the MOF 1. Reporting on Existing Class. 2. Pulling Registry Keys Using the Registry Property Provider. 3. Pulling Registry keys Using the Registry Instance Provider. 4. Adding information with Static class definitions 5. Pulling data using the View Provider

14 14 Registry Instance Provider #pragma namespace("\\\\.\\root\\CIMV2") instance of __Win32Provider as $InstProv { Name = "RegProv" ; ClsId = "{fe9af5c0-d3b6-11ce-a5b6- 00aa00680c3f}" ; }; instance of __InstanceProviderRegistration { Provider = $InstProv; SupportsPut = TRUE; SupportsGet = TRUE; SupportsDelete = TRUE; SupportsEnumeration = TRUE; }; Tells WMI that this is provider. Provider Name Some Thing like a GUID Indicating what actions the provider supports. Where to Put this Class.

15 15 Registry Property Provider #pragma namespace("\\\\.\\root\\CIMV2") instance of __Win32Provider as $PropProv { Name = "RegPropProv"; Clsid = "{72967901-68EC-11d0-B729- 00AA0062CBB7}"; }; instance of __PropertyProviderRegistration { Provider = $PropProv; SupportsPut = TRUE; SupportsGet = TRUE; }; Tells WMI that this is provider. Provider Name Some Thing like a GUID Indicating what actions the provider supports. Where to Put this Class.

16 16 Creating a WMI Class #pragma namespace("\\\\.\\root\\cimv2") [dynamic, provider("RegProv"), ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE \\Microsoft\\WindowsNT\\CurrentVersion\\Hotfix") ] class HotFixes {[key] string QNumber; [PropertyContext("Installed")] uint32 Installed; }; Where to Put this Class. What Provider to use. From Where to Collect the Information. What Key to collect and its Type.

17 17 Reporting that Class TO SMS #pragma namespace ("\\\\.\\root\\cimv2\\SMS") [SMS_Report(TRUE),SMS_Group_Name("Hotfixes"),ResID(5900),ResDLL("SMS_RXPL.dll"),SMS_Class_ID("MICROSOFT|HOTFIXES|1.0")] class HotFixes : SMS_Class_Template {[SMS_Report(TRUE),key] string QNumber; [SMS_Report(TRUE)] uint32 Installed; }; Where to Put this Class. Enabled this Class From Where to Collect the Information. Enable Disable This Instance. Supply the Name of the Instance and the Instance Type.

18 18 Reporting on Existing Class. #pragma namespace ("\\\\.\\root\\cimv2\\SMS") [SMS_Report(True), SMS_Group_Name("System Enclosure"), SMS_Class_ID("MICROSOFT|System_Encl osure|1.0")] class Win32_SystemEnclosure :SMS_Class_Template {[SMS_Report(True)] string Description; [SMS_Report(True)] string Manufacturer; [SMS_Report(True)] string Name; [SMS_Report(True)] string SerialNumber; }; Connect to the NameSpace Enable Disable the Class Name Of Group In SMS The WMI Class to Be reported to SMS. Enable Disable the Fields Supply the Name of the Field and the Field Type.

19 19 Deploying the MOF File in SMS. Back up Your Current SMS_DEF.MOF. Edit Your SMS_DEF.MOF File. Check your MOF File Using MOFCOMP.exe Put “The New” MOF file in to SMS\Inboxes\CliFiles.Src\Hinv Do this On Every Site server. Check your CAP, to see that the New file was updated. Wait for your Clients to get the New MOF File. Wait for your Clients to Run HW Inventory

20 20 Hardware Inventory Flow SMS Server CAP Server Clifiles.src\Hinv Inbox Manager Updates the CAP Clifiles.src\Hinv SMS Site Database SMS Client Inventory.box CCIM updates the client Mof file. Inbox Manager Assistant Updates the Site server HW inventory Runs: Compiles the Mof files, and Creates a Hiv file. Client Updates the Cap. Inventory DataLoader Updates the Database. SMS_Def.mof Is updated Inventory.box Dataldr.box

21 21 Client and server Logs Log filesServer components \SMS\Logs\Inboxmgr.logInbox Manager \SMS\Logs\Inboxast.logInbox Manager Assistant – at the CAP servers \SMS\Logs\Invproc.logInventory Processor SMS\Logs\Dataldr.logInventory Data Loader Log filesClient agents %Windir%\MS\SMS\Logs\Hinv32.logHardware Inventory Agent %Windir%\MS\SMS\Logs\Ccim32.logClient Component Installation Manager %Windir%\MS\SMS\Logs\Clisvc.logClisvc – Client service

22 22

23 23 How to Clean Up. Remove the undesired MOF from the machine and restore a functional Original SMS_DEF.Mof. Remove the classes from the WMI repository on the client using wbemtest.exe for a single client, or a script Or edit the SMS_DEF.Mof file. #pragma namespace("\\\\.\\root\\cimv2") #pragma deleteclass("TravelMode", NOFAIL)

24 24 How to Clean Up. Remove the class information (tables, etc) from the site server using delgrp.exe. Remove the classes from the WMI repository on the site server using wbemtest.exe. Remove the stored procedures for the classes deleted using SQL Server Enterprise Manager.

25 25 KB Articles & Links. Q202538 - How to Edit MOF Files with MOF Manager: Q199318 - How SMS Uses the SMS_DEF.MOF in Hardware Inventory Q328386 - How to Extend the SMS_DEF.Mof File by Using the Windows Management Instrumentation Registry Providers. Q235869 - How to Use Cliutils.exe to Force Inventory to Occur Q285780 - Increased Network Traffic When You Run Hardware Inventory.

26 26 MOF Editing Guide : http://www.myitforum.com/articles/1/view.asp?id=2169 http://www.myitforum.com/articles/1/view.asp?id=2169 Visit SMS Expert web site : http://www.smsexpert.com/ Visit www.myITForum.com for More information. www.myITForum.com Download the Master MOF Files: http://www.myitforum.com/articles/1/view.asp?id=2188 http://www.myitforum.com/articles/1/view.asp?id=2188 SMS Support Tools: http://www.microsoft.com/smserver/downloads/20/tools/spsupport/ http://www.microsoft.com/smserver/downloads/20/tools/spsupport/ KB Articles & Links.

27 27 Thank U for Coming Questions ?


Download ppt "1 SMS_DEF.MOF Editing Basics Oren Zippori Professional Services Team Computers & Systems Israel System Management User Group."

Similar presentations


Ads by Google