Задайте вопросЗадайте вопрос
 

ОтвеченоCustom MOF entry for single reg key value; IE

  • 7 мая 2009 г. 20:35rsmccall Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    My initial goal was to tap into the below reg key to determine the installed IE version:
    Local\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Exploer\Version

    But instead,

    I used Sherry Kissinger's Mini Monster MOF Builder (extremely useful tool!) to build the language.  I just have a few questions as how to go about doing this properly.  

    1st off here is the code for sms_def.mof:

    [SMS_Report(TRUE), SMS_Group_Name("Internet_Explorer"), SMS_Class_ID("SMSExpert|Internet_Explorer|1.0")]
    Class Internet_Explorer : SMS_Class_Template

    {
      [SMS_Report(TRUE), KEY] string   MachineName;
      [SMS_Report(TRUE) ] string   ActivePrinter;
      [SMS_Report(TRUE) ] uint32   CipherStrength;
      [SMS_Report(TRUE) ] string   ContentAdvisor;
      [SMS_Report(TRUE) ] string   IEAKInstall;
      [SMS_Report(TRUE) ] string   IEName;
      [SMS_Report(TRUE) ] string   Language;
      [SMS_Report(TRUE) ] string   Path;
      [SMS_Report(TRUE) ] string   ProductID;
      [SMS_Report(TRUE) ] string   Version;
      [SMS_Report(TRUE) ] string   AutoProxyDetectMode;
      [SMS_Report(TRUE) ] string   AutoConfigURL;
      [SMS_Report(TRUE) ] string   Proxy;
      [SMS_Report(TRUE) ] string   ProxyOverride;
      [SMS_Report(TRUE) ] string   ProxyServer;
      [SMS_Report(TRUE) ] string   ConnectionPreference;
      [SMS_Report(TRUE) ] uint32   EnableHttp11;
      [SMS_Report(TRUE) ] uint32   ProxyHttp11;
      [SMS_Report(TRUE) ] string   TempInternetFilesFolder;
      [SMS_Report(TRUE) ] string   PageRefreshType;
    };


    And here is the code for Configuration.mof:

    [JoinOn("MicrosoftIE_Summary.__Server = MicrosoftIE_LanSettings.__Server AND MicrosoftIE_Summary.__Server = MicrosoftIE_ConnectionSummary.__Server AND MicrosoftIE_Summary.__Server = MicrosoftIE_Cache.__Server"), 
      ViewSources{"SELECT __Server, ActivePrinter, CipherStrength, ContentAdvisor, IEAKInstall, Name, Language, Path, ProductID, Version FROM MicrosoftIE_Summary",
    "SELECT __Server, AutoProxyDetectMode, AutoConfigURL, Proxy, ProxyOverride, ProxyServer FROM MicrosoftIE_LanSettings",
    "SELECT __Server, ConnectionPreference, EnableHttp11, ProxyHttp11 FROM MicrosoftIE_ConnectionSummary",
    "SELECT __Server, TempInternetFilesFolder, PageRefreshType FROM MicrosoftIE_Cache"},
    ViewSpaces{"\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE", "\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE",
    "\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE", "\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE"}, Dynamic : ToInstance, provider("MS_VIEW_INSTANCE_PROVIDER")]

    Class Internet_Explorer

    {
      [PropertySources{"__Server", "__Server", "__Server", "__Server"}, key ] string MachineName;
      [PropertySources{"ActivePrinter", "", "", ""} ] string ActivePrinter;
      [PropertySources{"CipherStrength", "", "", ""} ] uint32 CipherStrength;
      [PropertySources{"ContentAdvisor", "", "", ""} ] string ContentAdvisor;
      [PropertySources{"IEAKInstall", "", "", ""} ] string IEAKInstall;
      [PropertySources{"Name", "", "", ""} ] string IEName;
      [PropertySources{"Language", "", "", ""} ] string Language;
      [PropertySources{"Path", "", "", ""} ] string Path;
      [PropertySources{"ProductID", "", "", ""} ] string ProductID;
      [PropertySources{"Version", "", "", ""} ] string Version;
      [PropertySources{"", "AutoProxyDetectMode", "", ""} ] string AutoProxyDetectMode;
      [PropertySources{"", "AutoConfigURL", "", ""} ] string AutoConfigURL;
      [PropertySources{"", "Proxy", "", ""} ] string Proxy;
      [PropertySources{"", "ProxyOverride", "", ""} ] string ProxyOverride;
      [PropertySources{"", "ProxyServer", "", ""} ] string ProxyServer;
      [PropertySources{"", "", "ConnectionPreference", ""} ] string ConnectionPreference;
      [PropertySources{"", "", "EnableHttp11", ""} ] uint32 EnableHttp11;
      [PropertySources{"", "", "ProxyHttp11", ""} ] uint32 ProxyHttp11;
      [PropertySources{"", "", "", "TempInternetFilesFolder"} ] string TempInternetFilesFolder;
      [PropertySources{"", "", "", "PageRefreshType"} ] string PageRefreshType;
    };


    My thought process tells me to paste the above code in their respective *.mof files on the site server and follow the procedures for "Monitoring Changes" on Sherry's blog site http://www.myitforum.com/myITWiki/SCCMINV.ashx and these changes will be adopted by clients.  

    All I really need is the version of IE so will the below code work?  I edited the above code so God knows if it'll work :)

    sms_def.mof:

    [SMS_Report(TRUE), SMS_Group_Name("Internet_Explorer"), SMS_Class_ID("SMSExpert|Internet_Explorer|1.0")]
    Class Internet_Explorer : SMS_Class_Template

    {
      [SMS_Report(TRUE) ] string   Version;
    };


    Configuration.mof:

    [JoinOn("MicrosoftIE_Summary.__Server = MicrosoftIE_LanSettings.__Server AND MicrosoftIE_Summary.__Server = MicrosoftIE_ConnectionSummary.__Server AND MicrosoftIE_Summary.__Server = MicrosoftIE_Cache.__Server"), 
      ViewSources{"SELECT __Server, Version FROM MicrosoftIE_Summary"},
    ViewSpaces{"\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE", "\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE",
    "\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE", "\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE"}, Dynamic : ToInstance, provider("MS_VIEW_INSTANCE_PROVIDER")]

    Class Internet_Explorer

    {
      [PropertySources{"Version", "", "", ""} ] string Version;
    };

Ответы

  • 8 мая 2009 г. 13:21rsmccall Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено
    If I paste the below code in their respective *.mof files on the site server and follow the procedures for "Monitoring Changes" on Sherry's blog site http://www.myitforum.com/myITWiki/SCCMINV.ashx these changes will be adopted by clients, and then I can start reporting on them?

    sms_def.mof

    [SMS_Report(TRUE), SMS_Group_Name("Internet_Explorer"), 

    SMS_Class_ID("SMSExpert|Internet_Explorer|1.0")]
    Class Internet_Explorer : SMS_Class_Template

    {
      [SMS_Report(TRUE), KEY] string   MachineName;
      [SMS_Report(FALSE) ] string   ActivePrinter;
      [SMS_Report(FALSE) ] uint32   CipherStrength;
      [SMS_Report(FALSE) ] string   ContentAdvisor;
      [SMS_Report(FALSE) ] string   IEAKInstall;
      [SMS_Report(TRUE) ] string   IEName;
      [SMS_Report(FALSE) ] string   Language;
      [SMS_Report(FALSE) ] string   Path;
      [SMS_Report(FALSE) ] string   ProductID;
      [SMS_Report(TRUE) ] string   Version;
      [SMS_Report(FALSE) ] string   AutoProxyDetectMode;
      [SMS_Report(FALSE) ] string   AutoConfigURL;
      [SMS_Report(FALSE) ] string   Proxy;
      [SMS_Report(FALSE) ] string   ProxyOverride;
      [SMS_Report(FALSE) ] string   ProxyServer;
      [SMS_Report(FALSE) ] string   ConnectionPreference;
      [SMS_Report(FALSE) ] uint32   EnableHttp11;
      [SMS_Report(FALSE) ] uint32   ProxyHttp11;
      [SMS_Report(FALSE) ] string   TempInternetFilesFolder;
      [SMS_Report(FALSE) ] string   PageRefreshType;
    };


    configuration.mof


      [JoinOn("MicrosoftIE_Summary.__Server = MicrosoftIE_LanSettings.__Server AND MicrosoftIE_Summary.__Server = MicrosoftIE_ConnectionSummary.__Server AND MicrosoftIE_Summary.__Server = MicrosoftIE_Cache.__Server"), 
      ViewSources{"SELECT __Server, ActivePrinter, CipherStrength, ContentAdvisor, IEAKInstall, Name, Language, Path, ProductID, Version FROM MicrosoftIE_Summary",
    "SELECT __Server, AutoProxyDetectMode, AutoConfigURL, Proxy, ProxyOverride, ProxyServer FROM MicrosoftIE_LanSettings",
    "SELECT __Server, ConnectionPreference, EnableHttp11, ProxyHttp11 FROM MicrosoftIE_ConnectionSummary",
    "SELECT __Server, TempInternetFilesFolder, PageRefreshType FROM MicrosoftIE_Cache"},
    ViewSpaces{"\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE", "\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE",
    "\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE", "\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE"}, Dynamic : ToInstance, provider("MS_VIEW_INSTANCE_PROVIDER")]

    Class Internet_Explorer

    {
      [PropertySources{"__Server", "__Server", "__Server", "__Server"}, key ] string MachineName;
      [PropertySources{"ActivePrinter", "", "", ""} ] string ActivePrinter;
      [PropertySources{"CipherStrength", "", "", ""} ] uint32 CipherStrength;
      [PropertySources{"ContentAdvisor", "", "", ""} ] string ContentAdvisor;
      [PropertySources{"IEAKInstall", "", "", ""} ] string IEAKInstall;
      [PropertySources{"Name", "", "", ""} ] string IEName;
      [PropertySources{"Language", "", "", ""} ] string Language;
      [PropertySources{"Path", "", "", ""} ] string Path;
      [PropertySources{"ProductID", "", "", ""} ] string ProductID;
      [PropertySources{"Version", "", "", ""} ] string Version;
      [PropertySources{"", "AutoProxyDetectMode", "", ""} ] string AutoProxyDetectMode;
      [PropertySources{"", "AutoConfigURL", "", ""} ] string AutoConfigURL;
      [PropertySources{"", "Proxy", "", ""} ] string Proxy;
      [PropertySources{"", "ProxyOverride", "", ""} ] string ProxyOverride;
      [PropertySources{"", "ProxyServer", "", ""} ] string ProxyServer;
      [PropertySources{"", "", "ConnectionPreference", ""} ] string ConnectionPreference;
      [PropertySources{"", "", "EnableHttp11", ""} ] uint32 EnableHttp11;
      [PropertySources{"", "", "ProxyHttp11", ""} ] uint32 ProxyHttp11;
      [PropertySources{"", "", "", "TempInternetFilesFolder"} ] string TempInternetFilesFolder;
      [PropertySources{"", "", "", "PageRefreshType"} ] string PageRefreshType;
    };
    • Помечено в качестве ответаrsmccall 11 мая 2009 г. 14:52
    •  
  • 11 мая 2009 г. 14:51rsmccall Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено
    It appears that everything ran fine.  I do have three new views now:  v_GS_Internet_Explorer(), v_HS_Internet_Explorer(), and vex_GS_Internet_Explorer()

    Here is the report I created:

    SELECT     dbo.v_R_System.Netbios_Name0, dbo.v_GS_Internet_Explorer0.IEName0, dbo.v_GS_Internet_Explorer0.Version0
    FROM         dbo.v_GS_Internet_Explorer0 INNER JOIN
                          dbo.v_R_System ON dbo.v_GS_Internet_Explorer0.ResourceID = dbo.v_R_System.ResourceID


    This did return a few computers with IE6 installed.  

    A big THANK YOU to Sherry!  
    • Помечено в качестве ответаrsmccall 11 мая 2009 г. 14:52
    •  

Все ответы

  • 7 мая 2009 г. 22:11Sherry KissingerMVP, МодераторМедали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    Well, nothing wrong with extending the mof.  It's my favorite activity!

    But... assuming you have the AI classes enabled, you might be able to get away with a lot less work.  You're just looking for a count, correct?

    Try this report:  http://smsug.ca/blogs/garth_jones/archive/2009/03/27/adding-publisher.aspx

    It's more information that you really wanted, but the IE versions and count of them are in there.

    -------------------------

    If that doesn't work, or isn't acceptable, I personally would not modify the individual elements of the original mof snippet.  You'd want to just change TRUE to FALSE on the individual things you do not want reported, with the exception of anything labeled a ,Key  field.  Key fields should always be TRUE. So you'd want something like this (note, this is just a bit of the code):

    [SMS_Report(TRUE), SMS_Group_Name("Internet_Explorer"), SMS_Class_ID("SMSExpert|Internet_Explorer|1.0")]
    Class Internet_Explorer : SMS_Class_Template

    {
      [SMS_Report(TRUE), KEY] string   MachineName;
      [SMS_Report(FALSE) ] string   ActivePrinter;
      [SMS_Report(FALSE) ] uint32   CipherStrength;
      [SMS_Report(FALSE) ] string   ContentAdvisor;
      [SMS_Report(FALSE) ] string   IEAKInstall;
      [SMS_Report(FALSE) ] string   IEName;
      [SMS_Report(FALSE) ] string   Language;
      [SMS_Report(FALSE) ] string   Path;
      [SMS_Report(FALSE) ] string   ProductID;
      [SMS_Report(TRUE) ] string   Version;
      [SMS_Report(FALSE) ] string   AutoProxyDetectMode;
      [SMS_Report(FALSE) ] string   AutoConfigURL;
      [SMS_Report(FALSE) ] string   Proxy;
      [SMS_Report(FALSE) ] string   ProxyOverride;
      [SMS_Report(FALSE) ] string   ProxyServer;
      [SMS_Report(FALSE) ] string   ConnectionPreference;
      [SMS_Report(FALSE) ] uint32   EnableHttp11;
      [SMS_Report(FALSE) ] uint32   ProxyHttp11;
      [SMS_Report(FALSE) ] string   TempInternetFilesFolder;
      [SMS_Report(FALSE) ] string   PageRefreshType;
    };

    Standardize. Simplify. Automate.
  • 8 мая 2009 г. 13:21rsmccall Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено
    If I paste the below code in their respective *.mof files on the site server and follow the procedures for "Monitoring Changes" on Sherry's blog site http://www.myitforum.com/myITWiki/SCCMINV.ashx these changes will be adopted by clients, and then I can start reporting on them?

    sms_def.mof

    [SMS_Report(TRUE), SMS_Group_Name("Internet_Explorer"), 

    SMS_Class_ID("SMSExpert|Internet_Explorer|1.0")]
    Class Internet_Explorer : SMS_Class_Template

    {
      [SMS_Report(TRUE), KEY] string   MachineName;
      [SMS_Report(FALSE) ] string   ActivePrinter;
      [SMS_Report(FALSE) ] uint32   CipherStrength;
      [SMS_Report(FALSE) ] string   ContentAdvisor;
      [SMS_Report(FALSE) ] string   IEAKInstall;
      [SMS_Report(TRUE) ] string   IEName;
      [SMS_Report(FALSE) ] string   Language;
      [SMS_Report(FALSE) ] string   Path;
      [SMS_Report(FALSE) ] string   ProductID;
      [SMS_Report(TRUE) ] string   Version;
      [SMS_Report(FALSE) ] string   AutoProxyDetectMode;
      [SMS_Report(FALSE) ] string   AutoConfigURL;
      [SMS_Report(FALSE) ] string   Proxy;
      [SMS_Report(FALSE) ] string   ProxyOverride;
      [SMS_Report(FALSE) ] string   ProxyServer;
      [SMS_Report(FALSE) ] string   ConnectionPreference;
      [SMS_Report(FALSE) ] uint32   EnableHttp11;
      [SMS_Report(FALSE) ] uint32   ProxyHttp11;
      [SMS_Report(FALSE) ] string   TempInternetFilesFolder;
      [SMS_Report(FALSE) ] string   PageRefreshType;
    };


    configuration.mof


      [JoinOn("MicrosoftIE_Summary.__Server = MicrosoftIE_LanSettings.__Server AND MicrosoftIE_Summary.__Server = MicrosoftIE_ConnectionSummary.__Server AND MicrosoftIE_Summary.__Server = MicrosoftIE_Cache.__Server"), 
      ViewSources{"SELECT __Server, ActivePrinter, CipherStrength, ContentAdvisor, IEAKInstall, Name, Language, Path, ProductID, Version FROM MicrosoftIE_Summary",
    "SELECT __Server, AutoProxyDetectMode, AutoConfigURL, Proxy, ProxyOverride, ProxyServer FROM MicrosoftIE_LanSettings",
    "SELECT __Server, ConnectionPreference, EnableHttp11, ProxyHttp11 FROM MicrosoftIE_ConnectionSummary",
    "SELECT __Server, TempInternetFilesFolder, PageRefreshType FROM MicrosoftIE_Cache"},
    ViewSpaces{"\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE", "\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE",
    "\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE", "\\\\.\\root\\CIMV2\\Applications\\MicrosoftIE"}, Dynamic : ToInstance, provider("MS_VIEW_INSTANCE_PROVIDER")]

    Class Internet_Explorer

    {
      [PropertySources{"__Server", "__Server", "__Server", "__Server"}, key ] string MachineName;
      [PropertySources{"ActivePrinter", "", "", ""} ] string ActivePrinter;
      [PropertySources{"CipherStrength", "", "", ""} ] uint32 CipherStrength;
      [PropertySources{"ContentAdvisor", "", "", ""} ] string ContentAdvisor;
      [PropertySources{"IEAKInstall", "", "", ""} ] string IEAKInstall;
      [PropertySources{"Name", "", "", ""} ] string IEName;
      [PropertySources{"Language", "", "", ""} ] string Language;
      [PropertySources{"Path", "", "", ""} ] string Path;
      [PropertySources{"ProductID", "", "", ""} ] string ProductID;
      [PropertySources{"Version", "", "", ""} ] string Version;
      [PropertySources{"", "AutoProxyDetectMode", "", ""} ] string AutoProxyDetectMode;
      [PropertySources{"", "AutoConfigURL", "", ""} ] string AutoConfigURL;
      [PropertySources{"", "Proxy", "", ""} ] string Proxy;
      [PropertySources{"", "ProxyOverride", "", ""} ] string ProxyOverride;
      [PropertySources{"", "ProxyServer", "", ""} ] string ProxyServer;
      [PropertySources{"", "", "ConnectionPreference", ""} ] string ConnectionPreference;
      [PropertySources{"", "", "EnableHttp11", ""} ] uint32 EnableHttp11;
      [PropertySources{"", "", "ProxyHttp11", ""} ] uint32 ProxyHttp11;
      [PropertySources{"", "", "", "TempInternetFilesFolder"} ] string TempInternetFilesFolder;
      [PropertySources{"", "", "", "PageRefreshType"} ] string PageRefreshType;
    };
    • Помечено в качестве ответаrsmccall 11 мая 2009 г. 14:52
    •  
  • 8 мая 2009 г. 14:08Sherry KissingerMVP, МодераторМедали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    Looks promising.  :-) 

    fyi, I do not currently have that exact edit in any of my labs; so I can't say how well it works.  For some reason, I have a vague memory that the root\\CIMV2\\Applications\\MicrosoftIE  namespace wasn't always used by the different IE versions.... but honestly I don't remember.  If after you implement it there is a decided lack of "ie 6" and you know you still have some out there, maybe that's the reason... 

    Sorry I can't be more definitive!
    Standardize. Simplify. Automate.
  • 8 мая 2009 г. 14:14rsmccall Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    I'm not sure if there are IE6 machines out there, my guess is no, but I cannot say for sure.  I suppose I could use one of my test machines and downgrade it to IE6 to see if it is picked up after I implement the new mof entries.

    I'll give it a go and will see what happens.  Thanks for your help Sherry!
  • 11 мая 2009 г. 14:51rsmccall Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено
    It appears that everything ran fine.  I do have three new views now:  v_GS_Internet_Explorer(), v_HS_Internet_Explorer(), and vex_GS_Internet_Explorer()

    Here is the report I created:

    SELECT     dbo.v_R_System.Netbios_Name0, dbo.v_GS_Internet_Explorer0.IEName0, dbo.v_GS_Internet_Explorer0.Version0
    FROM         dbo.v_GS_Internet_Explorer0 INNER JOIN
                          dbo.v_R_System ON dbo.v_GS_Internet_Explorer0.ResourceID = dbo.v_R_System.ResourceID


    This did return a few computers with IE6 installed.  

    A big THANK YOU to Sherry!  
    • Помечено в качестве ответаrsmccall 11 мая 2009 г. 14:52
    •  
  • 24 ноября 2009 г. 16:42Eahlmunde Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    If I were to need additional data such as the AvailableCacheSize and MaxCacheSize, would I be correct to add/edit the following lines in the above entries in sms_def.mof and configuration.mof?

    sms_def.mof:
      Add at end of SMS_REPORT list
           [SMS_Report(TRUE) ]    real32   AvailableCacheSize;
           [SMS_Report(TRUE) ]    real32   MaxCacheSize;

    configuration.mof
      Add to last Select statement so it reads -
         "SELECT __Server, TempInternetFilesFolder, PageRefreshType, AvailableCacheSize, MaxCacheSize FROM MicrosoftIE_Cache"},
         
      Add to PropertySources list
          [PropertySources{"", "", "", "AvailableCacheSize"} ] real32 AvailableCacheSize;
          [PropertySources{"", "", "", "MaxCacheSize"} ] real32 MaxCacheSize;

    Thanks in advance,
    Jon
  • 24 ноября 2009 г. 18:07Sherry KissingerMVP, МодераторМедали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Предложенный ответ
    real32

    hmm...  I've never seen real32 as a valid type within a mof file.  I'm not saying that it might not work--but I've never seen it.  You might want to use int32 instead.

    Otherwise, sure; try it and see what happens (in your lab environment first, of course)  Right?  Everyone has a lab, right?  even if it's a virtual lab with 1 client (the server itself).  Right?
    Standardize. Simplify. Automate.
    • Предложено в качестве ответаJho BIn 26 ноября 2009 г. 16:09
    •