Dell & HP Warranty Info in SCCM

Updated: 2011-08-18

This is the next evolution in the warranty info fight, Dell keep changing their site which is rather frustrating. I have re-written the Warranty Info Scripts in powershell as in my opinion the code is a lot cleaner and more manageable, I’ve tweaked the MOF edit required to read this.

One major change to the script is that I have added support for HP systems, now I must stress I only have one or two of these, both are out of warranty and only had base warranties so something may have been missed / may not work as expected. You can either fix it and let me know the changes you make or let me know, via the contact page, the tag of one of your systems and I will look at it when I get a chance.

If you use any other version of the script from my site you will need to update sms.mof as the reports have changed.

I am quite shameless so if you find this useful feel free to click on donate and well, donate. :D

What info do you get?

  • Index – Really just a count of each warranty instance – Not reported by default
  • DateScriptRan – Date and time the script was run – Default
  • Description – This is the blurb that tells us what the warranty is – Default
  • Provider – Dell provide this in their info, I fill in HP’s with “HP” – Default
  • StartDate – Date the warranty started
  • EndDate – Date the warranty Expires
  • DaysLeft – Number of days left on the warranty on the day the script was run (dell provide this, I calculate it for HP) – Not reported by default as I think it makes more sense to calculate in SQL when the report is run
  • Status – “Active” or “Expired” this is provided by HP and calculated by me for Dell, note it may be possible for a system to have 1 warranty expired but another active so check your reports carefully – Default

Usage:

  • Create a single package in SCCM containg all 3 scripts and the cmd file.
  • Create 3 programs in the package called “System Script 1”, “User Script”, “System Script 2” using the cmd file to run them
    “powershell.cmd systemscript1.ps1” …
  • Make “System Script 2” depend on “User Script” being run 1st (Using Run this program 1st option)
  • Make “User Script” depend on “System Script 1” being run 1st (Using Run this program 1st option)
  • System Scripts should run as admin and whether or not a user is logged in, User Script runs as user only when logged in.
  • Advertise”System Script 2″ to the collection as a mandatory assignment
  • Added the contents of the MOF file to your sms_def.mof
  • Copy the report “.mof” files to the sccm server, right click on reports in sccm console, choose “import object” and import them.
Program dependancies for powershell warrantyinfo

Known Issues:

  • The reports might need tweaking to your environment (especially if you have used an earlier version of the scripts.)
    • Right click on the report, choose properties, “Edit SQL Statement”
    • Browse the “Views” box until you find “v_GS_WarrantyInfoX” (where X is a number)
    • Click on “v_GS_WarrantyInfoX” and check that the fields on the right match those in the query below.
  • To work around the system account not being able to access the internet there are 3 scripts, 2 that run as admin and one that runs as the current logged in user, they must be run in sequence. This is mainly for vista/7 support as XP users can run the monalithic script as the themselves if they are admins.
  • A command prompt flashes on screen briefly.

ToDo:

  • Get rid of command prompt appearence.
  • Reduce to single script if at all possible for Vista/7

Updates:

  • 2011-08-18
    • Fixed call to “GetHPDaysLeft” using 2 parameters (the one that was being used was incorrect) instead of 1 (User Script)
  • 2011-07-28
    • Fixed $warrantydir not being removed. (System Script 2)
  • 2011-07-28
    • Fixed issue where Dell Warranties starting in the future placed extra tags around the days left.
  • 2011-07-26
    • Fixed Report MOF import error.
  • 2011-07-20
    • Fixed an invalid function call in “system 2” script.
  • 2011-07-08:
    • Fixed WMINamespace path in “system 2” script it was placing the class in the wrong location so sccm wasn’t picking up details (if you really want to clean up incorrect entry you could tweak the system 2 script to call the DeleteWMI function with the old path to the class)
    • Added reports

Files:

55 thoughts to “Dell & HP Warranty Info in SCCM”

  1. Just heads up, this works perfect with as a task sequence.

    Create a package with the 3 ps1 files and the cmd file. Then make a task sequence with 3 command line steps. Have each command line step run the ps1 file in order as specified in this article.

    Checkbox for each command line to use your package. Run under a domain user account with workstation admin permissions.

  2. @Nathaniel/Jacob,

    I would recommend Scott’s solution it’s much more elegant than mine.
    I’ll try and update my script anyway when I get time.

    Thanks for using it.

    Ryan

  3. This is great! Works wonders for HP, but it seems like Nathaniel is correct. No Dell reports are working for me now. Is it possible to get this updated?

  4. Hi Ryan,

    I’ve implemented your warranty check for some internal inventory reports I run and I’ve gotta say thanks!

    However, it looks like Dell recently updated their site and the warranty information doesn’t seem to be returned in the script correctly anymore. Any change you’ll be posting an update in the near future?

    Thanks!

Leave a Reply

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

*

This blog is kept spam free by WP-SpamFree.