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
- 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.
- 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.
- Get rid of command prompt appearence.
- Reduce to single script if at all possible for Vista/7
- Fixed call to “GetHPDaysLeft” using 2 parameters (the one that was being used was incorrect) instead of 1 (User Script)
- Fixed $warrantydir not being removed. (System Script 2)
- Fixed issue where Dell Warranties starting in the future placed extra tags around the days left.
- Fixed Report MOF import error.
- Fixed an invalid function call in “system 2” script.
- 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