SCCM Get Dell warranty info

2011-07-11: This method is now deprecated please go here: http://ninet.org/2011/07/dell-hp-warranty-info-in-sccm

LAST UPDATED: 2010-09-22

UPDATE 2010-09014: Dell have changed the layout to add an extra field in the contracts section so the scripts are broken

Version 2: work around for computer account that can’t access the internet http://ninet.org/2010/03/sccm-get-dell-warranty-info-v2/

I found a script and mof edit here: Sherry Kissinger’s Blog at myitforums.com

However when I tried it, it was completely broken all the data being returned in the wrong place. So I have rewritten it so that it is more modular and hopefully easier to maintain.

Now a bit of a disclaimer, my vbs skills are very rusty so the script works though it probably isn’t very efficient. So if you can suggest improvements please do and I’ll update the script as needed.

Although the code is long most of it is comments and “wscript.echo” statements for debugging, feel free to strip them out if you want something more compact.

I have also added the ability to dump the results to a csv file that you can collect with SCCM if you don’t want to capture from WMI.

Gotchas:

  • If you have used older versions of this script then you might need to change “v_gs_warranty_info0” to “v_gs_warranty_info1” or some other number.
  • If you get the error: “Object Name ‘v_gs_Warranty_Info0′ invalid.” It is likely your computer accounts cannot access the internet in order to download the data and insert it into WMI. Two ways to id this problem:
    1. On a client the script has been run on, open wbemtest -> Connect to “root\cimv2” and open the Class “Warranty_Info”. If there is no class then the script has either bailed due to afore mentioned problem or hasn’t been run as admin and so hasn’t got permissions to update WMI.
    2. Enable logging in the script, redeploy the script and look in the log file to see where it stops, this is the prefered method.

Change Log

Version 0.5 – 2010-09-22

  • Updated to account for Dell adding an extra field to the warranty table

Version 0.4 – 2010-03-17

  • Removed useless code (SMS reporting and deleteWMI root\cimv2\SMS)
  • Added Logging to file, disabled by default.

Files

Code:

Open “\inboxes\clifiles.src\hinv\sms_def.mof” and append the following:

//  <:[-<>>>>>>>>>>>>>>>>>>>>>>Begin>>-Warranty Info-<=]:>
#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
[ SMS_Report      (TRUE),
SMS_Group_Name  ("Warranty Info"),
SMS_Class_ID    ("CUSTOM|Warranty_Info|3.0") ]
class Warranty_Info : SMS_Class_Template
{
[SMS_Report(TRUE)] string DateScriptRan;
[SMS_Report(TRUE)] string ServiceTag;
[SMS_Report(TRUE)] string SystemType;
[SMS_Report(TRUE)] string ShipDate;
[SMS_Report(TRUE)] string DellIBU;
[SMS_Report(TRUE), Key] string Description;
[SMS_Report(TRUE)] string Provider;
[SMS_Report(TRUE)] string StartDate;
[SMS_Report(TRUE)] string EndDate;
[SMS_Report(TRUE)] uint32 DaysLeft;
[SMS_Report(TRUE)] string WarrantyExtended;
};
//  <:[-<>>>>>>>>>>>>>>>>>>>>>>End>>-Warranty Info-<=]:>

Report Code:

SELECT
 sys.netbios_name0,
 wi.datescriptran0 AS [Timestamp data gathered],
 wi.ServiceTag0 AS [Service Tag],
 wi.SystemType0 AS [System Type],
 wi.provider0 AS [Provider],
 wi.shipdate0 AS [Ship Date],
 wi.Description0 AS [Description],
 wi.Startdate0 AS [Warranty Start Date],
 wi.Enddate0 AS [Warranty End Date],
 wi.DaysLeft0 AS [Warranty Days Remaining],
 wi.WarrantyExtended0 AS [Warranty Extended],
 wi.dellIBU0 AS [Dell IBU]
FROM v_r_system as [SYS]
JOIN v_gs_Warranty_Info0 AS [WI]
ON sys.resourceid=wi.resourceid
ORDER BY sys.netbios_name0

29 thoughts to “SCCM Get Dell warranty info”

  1. Mike,

    It sounds like dell have changed their site layout yet again.
    I’ll do my best to take a peek at this and update the script.

  2. I’m not seeing the wmi class being populated. I commented out On Error Resume Next, and I’m getting a type mismatch error at If i = (cint(intShortlist)-1) then…. If i echo intShortlist, i’m getting a text value rather than an integer. (specifically, Next Business Day). Also, the Days left appears to be targetting the wrong column (returns end date instead).

  3. Anthony,

    I really hate saying this, but, again I am going to be of little use other than basic troubleshooting as I no longer have XP clients and the script has never worked (via SCCM only) for me due to our security setup.
    If I get a chance I’ll have a poke about and see, of all the OSs I’d have expected XP to have no problems due to it’s lack tiered security.

    Regards,

    Ryan

  4. Questiojn for you guys, but first a thankyou for all the work that has gone into this, THANKS!!

    Here’s my question (dilemma)i’ve run Ryans script on 3 windows 7 machines and have had great success. The files are created, the class is created and it gets picked up by the server and i can run the report and see the info that I am looking for.
    When I run this on an XP box, I can see that the log files are created and the class is created in WBEMtest, but I cannot get the info into the DB.
    I did notice that wbemtest in 7 points to root\cimv2 and in Xp it points to root\default, so I added an entry to the mos_def file to reflect that difference, I also modified the script to point to root\default for my xp machines, this did created the warranty info class but will not export the data to the DB…
    Any Ideas,

    Thanks in Advance,
    Tony

  5. JeffM,

    I’m afraid I am going to be unable to help you as I actually have no usb connected printers, here in work or at home. I’ve configured all mine so that the shares are restricted and can only be accessed by those with permissions. Additionally I don’t have any Dell printers, so even if I could communicate with mine you still might not be able to with yours.

    You can use the wmi query “Select * from win32_printer” which will list all printers that a computer knows about and includes details such as port (be it tcp/ip or usb). Downside to this is that printers are a “per user” device not a system wide device so the query would need to be run as the user that has the printers in their profile (which may or may not be all users of a system).

    Another idea which jumps to mind is that a lot of printers support telnet for management, perhaps those connected via usb expose a serial type connection you could use Putty to connect to?
    You might be able to connect via telnet/serial and capture the output.

    I personally think your best solution is the 3rd party one, this is not a cop out, it’s simply a case of it’s not a problem I have nor can replicate in order to look into so I cannot be of any real help in this instance.

    If you can get the service tags the above scripts can be easily modified to parse a file containing them and return a CSV of the warranties of each.

    Keep an eye on the site though, I will have an interesting custom program coming up soon which will of interest to those that use Cisco for networking & SCCM for systems management.

    Regards,

    Ryan

  6. RyanM: I think you misundertood and didn’t quite read my detail :-)
    1) Ms. Kissinger indeed stated this could be used for printers (which you confirmed); in fact, there are several “pointers” to this and similar locations just for that purpose
    2) And, this is the MOST important part: NONE of the scripts, not even ‘tweaked,’ will work for us, because we are NOT NETWORKED (the printers, I mean; I clearly stated they are USB-ONLY).

    So, any hints or clues as to how to “tickle” the printer (via USB001, for example), to dump out its Service Tag, would be greatly appreciated. Since they are not networked via the LAN port, we cannot use the Web interface – if we could, it would be a no-brainer.

    That said, we did indeed ‘share’ all printers, so we were able to do a “copy /b firmware.??? \\remote-box\printer-share” – and that worked; so, clearly, there is the possibility of communicating to the printer ‘remotely’ even though we have no LAN printers; they are USB-ONLY. I hope I have clarified.

    So, there should be a way to ‘query’ over the printer share and/or a redirected LPT1: –> USB001, to “send a command” to the printer, to get it to output (or send back) it’s “Serial Number” – ideally, we want the Service Tag and, from what I am seeing, printing these Asset Report and Device Satistics pages shows only a “Serial Number” (beginning with “72”) and NOT the Service Tag (which begins with “52”). So, clearly the Serial Number is stored somewhere in the printer.

    So, again, any help or clues about getting printer info from printers that are USB-ONLY – would be greatly appreciated.

    Most or ALL servers/desktops/laptops have the Service Tag and/or Serial Number in BIOS – this was “a long time coming” and did not used to be the case (back in days of old); and now, we MUST push the vendors to always put PRINTER SERIAL # also in a retrievable, WMI-exposed location – Is that too much to ask for? I think not. It is THE ONE THING that most system admins direly need, in order to maintain asset inventories – and PLEASE don’t steer me to 3rd party solutions – this SHOULD BE AN *INDUSTRY STANDARD*; just like PrinterName, DriverName, ShareName – those values that already are avaiable.

    So let’s hear it for a standard, printer management, callable interface for EVERY manufacturer’s printer; where the interface always will be able to be polled for; and will return; the printer Service Tag and Serial Number; EVEN if the printer is ‘local’ and not LAN-connected. — end soap-box. Thanks.

  7. JeffM,

    I think you have misunderstood the purpose of these scripts.

    They have nothing to do with printers.

    They get the serial number of a computer from WMI, connect to the dell site supplying the serial and grab the warranty info for the computer.

    In saying that, a bit of tweaking could do something for printers. Most printers have a web interface which, in the case of dell, has the serial number of the printer on it. So you could supply a list of printer names to a script which parses those printer interfaces, grabs the serial then use parts of the script here to do the rest.

    Ryan

  8. Was I wrong or I misinterpreted something? This script and related MOF edit are supposed to be “the magic bullet” (per S. Kissinger’s comments and other comments) that should allow retrieval of *PRINTER* service tag from Dell site – we have ZERO ‘network’ printers, due to security; thus ALL our printers are mapped directly/connected direct to USB.

    Upon reading Technect/Microsoft blogs, various comments led me to believe these items could allow me to gather and populate the PRINTER SERIAL # into WMI – but no such thing – at least not Kissinger’s standalone vbscript – it only lists the COMPUTER service tag – which is good, but not what i needed.

    I will try your suggested SMS/SCCM report and see what that turns up, but clearly I was misled to believe this might do the trick (at least in the interim) – but, how would my PC know to query Dell’s site for the particular printer attached to the PCs USB port?

    Now, yes, if we ‘networked’ the printers, it would be a no-brainer, because Dell (LexMark re-branded printers) HAVE the printer asset tag in the firmware – just print off a settings page – you will see it, but no way to get that info via USB – in other secure institutions, I’m sure this need for asset/service tag info is just as prevalent – Dell does provide a Lexmark firmware update piece, where I can share the printer on the PC itself, then copy /b \\box\share.
    So, clearly, I can UPDATE (write) the firmware/bios; wouldn’t it be simple enough for them to modify that fimrware update and/or allow a copy/b “BIOSConfig-info.???” FROM the PC share (print share) to the local c:\ drive and then provide a utility to parse that binary config for the Service Tag?

    I just had lunch with our Dell sales rep and he said to send the suggestion to Frank Mok, our local and/or regional engineer – he is going overseas to talk with the developers, and it might be something they can accomplish.

    Clearly, there’s no clean/standard interface for talking directly to/from the USB001 port, for example, like there was in the days of LPT1: (serial) port communication – there are workarounds, where we can share the printer locally on the machine, then redirect LPT1: to that share; and THEN we can sort of communicate and/or push firmware to the printer port.

    Any thoughts appreciated – and PLEASE don’t direct me to whatever 3rd party company is providing services to accomplish this – that’s a lazy thing to do – this needs to be ” thought out” and FIXED – locally, by Dell, Lexmark, and other manufacturers, so that we have some way to interface with PRINTER FIRMWARE/BIOS and gather Service Tag / Serial # info from printers! (YES, even “non-networked;” i.e., local USB-based printers!) Thanks for listening!

  9. Moved your posts as we are talking about this script so it makes sense to have the thread here.

    First thing I would do is uncomment the wscript.echo statements. That will show you all the calls and which functions you are in.

    Try changing from “C:\warrantyinfo” to “C:\Documents and Settings\administrator\Desktop\warrantyInfo.csv”

    C:\ can be protected from writes by the OS (definitely Vista/7/2008).

    I recommend opening a command prompt as admin and then using “cscript.exe warrantyinfo.vbs”, all the output will be in the command window and you won’t be clicking OK every 5seconds.

    You can use http://pastebin.com/ if you want to post output for me to see or if you are worried about confidentiality then use the contact form on the site to contact me and I’ll mail you back with my email address and you can mail me directly.

    Regards,

    Ryan

  10. Been testing this on several servers now and still have not managed to get anywhere. I only get the WMI entry created, but nothing else happens after that. I am able to copy and paste the link into the IE on same servers to get to the Dell’s web site, so there is no blockage.
    One other thing is, when I change Const TOFILE to true – as below, it does not create the csv file as it should.

    ‘ Write output to file instead of to WMI
    Const TOFILE = true
    Const OUTFILE = “C:\warrantyInfo.csv”

    Really appriciate all your help.

  11. @Lat

    I have the exact same issue right now. I was able to populate WMi though by using the vbs script mentioned on Sherry Kissinger’s Blog.

  12. Slowly I am getting somewhere…Using WMITools, I have noticed that Warranty_Info gets created within WMI. When I select this, it tells me ‘The Selected classes do not have instances.’ So obviously it does not populate the WMI with the warranty information it collects.
    Script I am testing is the one http://ninet.org/2010/03/sccm-get-dell-warranty-info/ (under Files) and since my machine (Win7 64-bit) has full rights, I am guessing this is the reason it is working.
    Main reason I wanted to use this script is to get warrany on all out servers. The other two systems I am testing this on are Windows 2003 and Windows 2008 – both 64-bit OS’s.

  13. Hey Ryan,

    Been following your blog for a while with a great interest.
    I just wanted to implement your script to our SCCM server as we are a Dell house, thinking it will be extremely useful for us to be able to view warranty status of our servers.
    Previously, we had the very original script up and running from S Kisseinger’s site and recently noticed that it was not working anymore. So a quick google pointed me to your web site.
    I have everything setup as instructed and it is not seem to be working for me.
    To start with I am running the script manually to create the log files and understand how it all works. I can get the c:\windows\logs\SCCM-Dell_Warranty_Info file created and it has an info:
    9/6/2010 11:10:00 AM,Main,,Script starting
    9/6/2010 11:10:00 AM,getServiceTag,,Service Tag: J****
    9/6/2010 11:10:00 AM,Main,,Getting Dell Page from Web
    (Is this all you’re supposed to see?)

    My main question is, I cannot get the c:\warrantyInfo.csv created?! Although script seems to run fine as I get no errors, I have no idea what is going on. (I have changed Const TOFILE = to TRUE within script).
    Is there anything else you can recommend that I can do?
    Many thanks and keep up the good work.

  14. @Phil,

    The error is caused by “shortlist” being empty.

    stick “wscript.echo shortlist” above that line and you’ll see.

  15. Thanks for this great info. The script completes successfully and does not create the Class. I commented out “On Error Resume Next” and there are a few issues it finds that I was able to correct. But I cannot get around this one:
    “Microsoft VBScript runtime error (357, 2) : Invalid procedure call or argument: ‘Right'”

    Any idea how to correct this line in the code:

    arrShortlist = split(Right(shortlist, len(shortlist)-1), “|”)

    Thanks
    Phil

  16. I that’s an HTTP error. That indicates that the computer account likely has not got permission to access the internet.

    If you use wbemtest to open the class are there any instances in existance?

    If not try running the script locally as an administrative user. If instances appear in the class after that then it is defo the comptuer account causing the problems.

    I am working on 2 scripts to try and work around the issue.
    1. http://ninet.org/2010/03/sccm-get-dell-warranty-info-v2/ uses 2 scripts run in sequence to access the data as the current user then populate it as admin.

    2. This script isn’t on the blog yet but basically it connects to sccm, gets a list of computers and their tags dumping the warranty info for all computers into a csv file. The sccm admin then copies that file into a package with a 2nd script. The 2nd script will run on the computer, look at the csv file for all references to that computer and then will populate the WMI with the info so SCCM can collect it.

  17. Hello, so in the Class “Warranty_Info” there Is a class “Warranty_Info” so it seems to be correct by cons in the log I get an error: “Failed in WinHttpSendRequest API, ErrorCode = 02xefd thank you.

  18. The script looks pretty efficient to me, and works great!

    Admin Edit:
    Shortened Name and removed Link as I am unsure if this is a Spammer or not. Sorry if not.

  19. After a relocation package and publication, I have another error:

    An error occurred while running the report. The details are as follows:
    Invalid column name ‘DaysLeft0’.
    Error number: -2147217900
    Source: Microsoft OLE DB Provider for SQL Server
    Original error: 207

  20. Cyrielle,
    I’ll add the meat of the response to the GOTCHAs section as it will be useful to others.
    But in short “v_gs_Warranty_Info0” doesn’t exist, so potential causes are:

    1. SCCM hasn’t polled the machine to get the data from WMI yet.
    2. The script hasn’t been run as admin, and cannot update WMI.
    3. The computer account hasn’t got internet access so cannot to the dell site to get the info and the script has bailed.

  21. Hello, I followed your procedure but when I run my report it myself out this error:
    An error occurred while running the report. The details are as follows:
    Object Name ‘v_gs_Warranty_Info0’ invalid.
    Error number: -2147217865
    Source: Microsoft OLE DB Provider for SQL Server
    Original error: 208
    What is the problem? Thank you.

  22. I’ll poke around and see if i can find that article you are talking about as well. We are an HP shop and this would be a great tool. Thanks for the quick reply.

  23. @Per: Downloadable files added.

    @Whitefearn: If they have a webpage to view that info then yes it should be possible. It’s just a matter of parsing it. I have split the script so that it is broken down into procedures and Functions so it should be easy for you to just modify 1 or 2 sections.

    If it were me I would copy the MOF edit and change it to reflect what fields are provided by HP. Then have the scripts modify the WMI to relect those changes. This way if you have Dell or other systems then the WMI info is seperate and can be queried seperately or merged in an SQL statement.

    As a side note there is a script running about that lists all the systems with a link to the warranty page, I found it on the myitforms I think. I’ll try and get a post up with it on it later.

    I only have a few HP servers, but if you do most of the leg work, I’d be happy to help customise the script so that it is “smart” and will get the warranty info depending on manufacturer.

Leave a Reply

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

*

This blog is kept spam free by WP-SpamFree.