boot.ini inventarisieren

In Foren tritt manchmal die Frage auf, ob SMS/SCCM auch den Inhalt der boot.ini inventarisieren kann.  Bisher war meine Antwort meistens: "Klar. Skript schreiben, boot.ini auslesen, Inhalt in die WMI schreiben, sms_def.mof anpassen".

Durch Zufall bin ich über einen Registrykey gestoplert, der den Inhalt der boot.ini (und BCD bei Server 2008 / Vista) beinhaltet: HKLM\SYSTEM\CurrentControlSet\Control. Wie praktisch. Einfach die sms_def.mof (und configuration.mof) anpassen und schon hat man diese Infos inventarisiert.

Im Resource Explorer sieht’s dann so aus:

clip_image002

Die boot.ini an sich so:

clip_image002[4]

Folgende Änderungen müssen dazu an der sms_def.mof / configuration.mof vorgenommen werden (Änderungen auf eigene Gefahr! Vor produktivem Einsatz in einem Testlab testen!)

 

sms_def.mof

//=================================================================================
// mssccmfaq.de – BootInfo
//=================================================================================

#pragma namespace ("\\\\.\\root\\cimv2\\sms")

[ SMS_Report     (TRUE),
  SMS_Group_Name ("BootInfo"),
  SMS_Class_ID   ("MSSCCMFAQ|BootInfo|1.0") ]

class BootInfo : SMS_Class_Template
{
    [SMS_Report (TRUE), key ]
         string KeyName;
    [SMS_Report (TRUE)      ]
        string SystemBootDevice;
    [SMS_Report (TRUE)      ]
        string SystemStartOptions;
};

configuration.mof

//=================================================================================
// mssccmfaq.de – BootInfo
//=================================================================================

#pragma namespace ("\\\\.\\root\\cimv2")
#pragma deleteclass("BootInfo", NOFAIL)

[DYNPROPS]
class BootInfo
{
                [key] string  KeyName = "";
        string SystemBootDevice;
        string SystemStartOptions;
};

[DYNPROPS]
instance of BootInfo
{
    KeyName = "Bootinfo";

    [PropertyContext("local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control|SystemBootDevice"),
        Dynamic, Provider("RegPropProv")]
    SystemBootDevice;

    [PropertyContext("local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control|SystemStartOptions"),
        Dynamic, Provider("RegPropProv")]
    SystemStartOptions;
};

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert