Updating Assets in Service Manager / Cireson – Part 2: Retrieving Toshiba Warranty Information to System Center Configuration Manager 2012

It’s been a long time since I lasted posted anything on my blog and a lots changed since my first posts. There has been so much I’ve worked on but not had the chance to blog, this however was a must…

I’ve recently been working with my colleague Robert Ryan on implementing Service Manager 2012 R2 with the Cireson Management Suite, you can read part 1 hereon Robs’ blog.

We successfully retrieved Dell, Lenovo asset information using Scott Keiffers’ blog and expanded Carlos Rodriguez’s HP Warranty information to get HP too, I’ll look at posting the HP solution at a later date.

Carlos Rodriguez’s HP Warranty
Dell Lenovo Warranty 

 Our next problem was Toshiba… We needed a solution to capture warranty information ideally through information in SCCM. With a bit of PowerShell magic and SCCM we’ve managed to get the job done.

Part 1. Extending the SCCM hardware inventory MOF file.

 

I trolled through the various SCCM SQL views but it was hit and miss for the information we needed. This lead us to creating our own MOF configuration file using Mark Cochrane’s RegtoMoftool. This allowed us to get a SQL view with the current Serial and Part Number required for the warranty check.


  • To create the view, first import the below text to the extensions section of the Configuration.mof file under “Microsoft Configuration Managerinboxesclifiles.srchinv” on your primary site server.  

//========================
// Added RR_SystemBios
//========================

#pragma namespace (“\\.\root\cimv2“)
#pragma deleteclass(“RR_SystemBios”, NOFAIL)
[DYNPROPS]
Class RR_SystemBios
{
[key] string KeyName;
Uint32 BiosMajorRelease;
Uint32 BiosMinorRelease;
Uint32 ECFirmwareMajorRelease;
Uint32 ECFirmwareMinorRelease;
String BaseBoardManufacturer;
String BaseBoardProduct;
String BaseBoardVersion;
String BIOSReleaseDate;
String BIOSVendor;
String BIOSVersion;
String SystemFamily;
String SystemManufacturer;
String SystemProductName;
String SystemSKU;
String SystemVersion;
};

[DYNPROPS]
Instance of RR_SystemBios
{
KeyName=”RegKeyToMOF_32″;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|BiosMajorRelease”),Dynamic,Provider(“RegPropProv”)] BiosMajorRelease;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|BiosMinorRelease”),Dynamic,Provider(“RegPropProv”)] BiosMinorRelease;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|ECFirmwareMajorRelease”),Dynamic,Provider(“RegPropProv”)] ECFirmwareMajorRelease;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|ECFirmwareMinorRelease”),Dynamic,Provider(“RegPropProv”)] ECFirmwareMinorRelease;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|BaseBoardManufacturer”),Dynamic,Provider(“RegPropProv”)] BaseBoardManufacturer;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|BaseBoardProduct”),Dynamic,Provider(“RegPropProv”)] BaseBoardProduct;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|BaseBoardVersion”),Dynamic,Provider(“RegPropProv”)] BaseBoardVersion;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|BIOSReleaseDate”),Dynamic,Provider(“RegPropProv”)] BIOSReleaseDate;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|BIOSVendor”),Dynamic,Provider(“RegPropProv”)] BIOSVendor;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|BIOSVersion”),Dynamic,Provider(“RegPropProv”)] BIOSVersion;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|SystemFamily”),Dynamic,Provider(“RegPropProv”)] SystemFamily;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|SystemManufacturer”),Dynamic,Provider(“RegPropProv”)] SystemManufacturer;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|SystemProductName”),Dynamic,Provider(“RegPropProv”)] SystemProductName;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|SystemSKU”),Dynamic,Provider(“RegPropProv”)] SystemSKU;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS|SystemVersion”),Dynamic,Provider(“RegPropProv”)] SystemVersion;
};
//========================
// Added RR_SystemBios End
//========================


    • Copy the below text into a new MOF file using notepad and save it ready to import into SCCM.

     #pragma namespace (“\\.\root\cimv2\SMS“)
    #pragma deleteclass(“RR_SystemBios”, NOFAIL)
    [SMS_Report(TRUE),SMS_Group_Name(“RR_SystemBios”),SMS_Class_ID(“RR_SystemBios”)]
    Class RR_SystemBios: SMS_Class_Template
    {
    [SMS_Report(TRUE),key] string KeyName;
    [SMS_Report(FALSE)] Uint32 BiosMajorRelease;
    [SMS_Report(FALSE)] Uint32 BiosMinorRelease;
    [SMS_Report(FALSE)] Uint32 ECFirmwareMajorRelease;
    [SMS_Report(FALSE)] Uint32 ECFirmwareMinorRelease;
    [SMS_Report(FALSE)] String BaseBoardManufacturer;
    [SMS_Report(FALSE)] String BaseBoardProduct;
    [SMS_Report(FALSE)] String BaseBoardVersion;
    [SMS_Report(FALSE)] String BIOSReleaseDate;
    [SMS_Report(FALSE)] String BIOSVendor;
    [SMS_Report(FALSE)] String BIOSVersion;
    [SMS_Report(TRUE)] String SystemFamily;
    [SMS_Report(TRUE)] String SystemManufacturer;
    [SMS_Report(TRUE)] String SystemProductName;
    [SMS_Report(TRUE)] String SystemSKU;
    [SMS_Report(TRUE)] String SystemVersion;
    };

      • Next open the Configuration Manager console and go to Client Settings under administration.

      • Edit the default client settings and under hardware inventory select ‘Set Classes…’

        • Import the new MOF file into the classes section.

         

              

        • Apply the settings and ensure the RR_SystemBios class is imported and showing on the Hardware Inventory classes. If you don’t use the default client for deployments, un-tick the class and add it to the relevant client setting. 

         



        • (Optional) you can confirm the class is being collected by checking the v_GS_RR_SystemBios0 view from the SCCMCMDB. For testing, you can force a machine policy retrieval and hardware inventory cycle on the clients to force the data to be collected.

         
         
         
         
         
         
         
        Part 2. Running the PowerShell magic to retrieve the warranty information
         
        Now we have the data being collected in the SCCMCMDB, we need to have some fun with PowerShell. There are two parts, The Get-ToshibaWarranty function and the PowerShell to SQL script.
         
        The function is merely retrieving the warranty information based on the serial and part number of the asset. We decided against including WMI computer query to run against remote machines to get the serial and model as we are only using this for information already from SCCM.
         
        The PowerShell2SQL script is adapted from Scott Kieffer’s script utilising the Database Name for neatness but creating a new completely Toshiba Warranty table.
         
         
        • Download the Toshiba Warranty Function Here
        • Copy the function to “C:WindowsSystem32WindowsPowerShellv1.0Modules”
        • Ensure you run the Script with an account that has Internet Access and Access to the SQL Server where the SCCMCMDB is held.
        • Run the “ToshibaWarrantyInfoSQL.ps1 -SQLServer <PrimaryServer.Domain> -SiteCode <SCCMSiteCode>”. It will scan for all Toshiba devices in the CMBD and check each device warranty, returning the results to the ComputerWarrantyToshibaWarranty DB table.

        We’ve got this script running on our on-premise Azure SMA runbook on a monthly schedule. You can equally have this running on Orchestrator or even a task sequence on the server itself.

        Part 3. Getting the information into Cireson from SQL

        The last step is using Cireson’s Asset Import connector to import the warranty information then Orchestrator to associate the warranty to the hardware assets.

        I’m not going to go into details on this one just yet but may do a post at a later date.

          Leave a Reply

          Your email address will not be published. Required fields are marked *