Lansweeper logo
Home Download Features Demo Buy now Help Support forum
 
    Most requested support articles:
  Lansweeper troubleshooting guide.
  The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
  WMI Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
  How to configure the windows firewall using group policies.
  Support:  
 support@lansweeper.com  
Skype: Lansweeper  
  Mo-Fri 9h-17h CET  
Welcome Guest Search | Active Topics | Log In | Register

9 Pages123>»
Tag as favorite
Update LS database with warranty information from Dell's site
Corbett
#1 Posted : Wednesday, December 16, 2009 5:12:50 PM

Rank: Premium user

Groups: Premium Users
Posts: 31
Location: US
This isn't exactly a "custom action" but this topic seems the best. I wrote an application that when executed it will update the Purchase Date and Warranty Date custom fields of all Dell computers in the LS database. It accomplishes this by making an HTTP request to Dell's support site and pulling down the appropriate dates. Some assumptions are made here: The oldest date found on the support page is the purchase date and the most recent date found on the page is the warranty expiration date.

EDIT (3/21/2012): Dell changed their support site which broke the program. The program now uses the web service that Dell provides for getting warranty information. Due to this change a new line needs to be added to the .config file:

Quote:
<add key="DellWarrantyURL" value="http://xserv.dell.com/services/assetservice.asmx"/>


This is a .NET application and therefore requires Framework 3.5.

Before running the program be sure to edit the .config file and set the connectionString option with the appropriate SQL Server computer name, database name, username and password.

In my situation I used the Task Scheduler to run this application once a week (UpdateDellWarrantyInfo -all) to make sure all computers have the most recent warranty information and once a day
(UpdateDellWarrantyInfo -warrantyInfo) to get the warranty information for new computers.

12/21/2009, 4:15PM ET - Added most recent version of utility.
12/24/2009, 10:50AM ET - Attached most recent version (v1.4) of utility and updated the documentation.
01/04/2010, 1:30PM ET - Fixed bug where invalid Asset Tags (AAAAAA5 for example) would throw an exception. It now just skips it and keeps going. Attached v1.5.
01/13/2010, 10:07AM ET - Added a proxy authentication mechanism (integrated authentication only), fixed a SQL statement that failed on SQL 2000, added -verbose option for troubleshooting (rewrote argument handling routines), added stack trace to error output for additional troubleshooting. Attached v1.6.
01/18/2010, 8:16AM ET - Rewrote date handling routine to better handle different date formats. Attached v1.7.
07/02/2010, 12:16PM ET - I haven't had much time to maintain this lately. Attached v1.7 of the source.
03/21/2012, 8:26AM ET - Rewrote the warranty fetch routine to use the Dell web service. Note this version now requires a DellWarrantyURL key in the .config file. Attached v2.0.

Code:
Usage: UpdateDellWarrantyInfo [options] [-verbose]

Options

-all
Will update the warranty information for all Dell computers in the Lansweeper
database.

-warrantyInfo
Will update the warranty information only for the Dell computers that have
empty warranty and purchase dates in the Lansweeper database.

-assetTag <assetTag>
Will update the warranty information for a single Dell computer based on the
asset tag.  Must provide a single asset tag.

-computer <computerName>
Will update the warranty information for a single Dell computer based on the
computer name.  Must provide a single computer name.

-verbose
Print troubleshooting information to the console.

-help
Will display this screen.

NOTE: If no options are provided, will update all Dell computers.
File Attachment(s):
UpdateDellWarrantyInfo.v1.7.zip (6kb) downloaded 633 time(s).
UpdateDellWarrantyInfo.v1.7.src.zip (64kb) downloaded 218 time(s).
UpdateDellWarrantyInfo.v2.0.zip (9kb) downloaded 137 time(s).
DGoodwin
#2 Posted : Thursday, December 17, 2009 6:01:55 PM

Rank: Premium user

Groups: Premium Users, Member
Posts: 49
Location: NC, USA
If you are using Integrated Authentication chage the values in the config like so:

<add key="connectionString" value="Data Source=SERVER;Initial Catalog=lansweeperdb;Integrated Security=True;Connection Timeout=400"/>

Works for me now.

Thanks..!
Stuart robinson
#3 Posted : Friday, December 18, 2009 7:46:37 PM

Rank: Premium user

Groups: Premium Users
Posts: 2
Looks like a great tool which I would like to use - However it does not seem to like the euro format for dates - DD/MM/YYY

Here is the error I get when I run it here in the UK. (Ran application on 18th December 2009)

18/12/2009 18:41:33+Query for: REDLC0200
System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at UpdateDellWarrantyInfo.warrantyInfo..ctor(String URL, String ServiceTag)
at UpdateDellWarrantyInfo.Program.Main(String[] args)

FYI my SQL 2008 server date format is...

select GETDATE() = 2009-12-18 18:45:47.377

wgknowles
#4 Posted : Friday, December 18, 2009 8:40:47 PM

Rank: Premium user

Groups: Premium Users
Posts: 34
Location: California
An Excellent tool, one other bug:

We have had a number of motherboards replaced, and they come from the factory with a strange non-alphanumeric tag # programmed in the bios. Eventually we will go around and get the right tag # in the bios, but it is crashing the scanner. Can you put a try catch around the loop so that is handles problems like this gracefully and skips to the next computer?

Thanks for this GREAT tool!

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative
and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at UpdateDellWarrantyInfo.warrantyInfo..ctor(String URL, String ServiceTag)
at UpdateDellWarrantyInfo.Program.Main(String[] args)
wgknowles
#5 Posted : Friday, December 18, 2009 8:47:39 PM

Rank: Premium user

Groups: Premium Users
Posts: 34
Location: California
One other thought, could you make the default behavior be to skip computers that already have these fields populated, and perhaps have a flag to update all records? We have 1800 computers in our network and this takes several hours to run to update about 5 new computers.
Corbett
#6 Posted : Monday, December 21, 2009 4:37:16 PM

Rank: Premium user

Groups: Premium Users
Posts: 31
Location: US
Excellent suggestions. I had already planned on adding some command line arguments to allow for some customization. If you don't provide any parameters it still updates all computers. You can now update only computers that have blank warranty information or a single computer based on Asset Tag or Computer Name.

I also added some validation to ensure that the Asset Tag only contains alphanumeric characters.

Here is the -help output of the v1.1 of the application.

Code:
Usage: UpdateDellWarrantyInfo [options]

Options

-all
Will update the warranty information for all Dell computers in the Lansweeper
database

-warrantyInfo
Will update the warranty information only for the Dell computers that have
empty warranty and purchase dates in the Lansweeper database.

-assetTag <assetTag>
Will update the warranty information for a single Dell computer based on the
asset tag.  Must provide a single asset tag.

-computer <computerName>
Will update the warranty information for a single Dell computer based on the
computer name.  Must provide a single computer name.

NOTE: If no options are provided, will update all Dell computers.

DGoodwin
#7 Posted : Monday, December 21, 2009 4:48:25 PM

Rank: Premium user

Groups: Premium Users, Member
Posts: 49
Location: NC, USA
Having trouble with the first empty on the -warrantyinfo switch. Seems like it's trying to force the first empty and not looking to see if it's manufacturer is "dell".

12/21/2009 10:45:52 AM+Query for: ASVR01
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative
and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at UpdateDellWarrantyInfo.warrantyInfo..ctor(String URL, String ServiceTag)
at UpdateDellWarrantyInfo.Program.Main(String[] args)


When i run without switches, it runs fine.
Corbett
#8 Posted : Monday, December 21, 2009 8:21:26 PM

Rank: Premium user

Groups: Premium Users
Posts: 31
Location: US
Thanks for pointing this out. You're right, my SQL Query was returning all computers that had blank Warranty Information. I've updated the attachment to v1.2 to include only Dell computers.
googoo
#9 Posted : Monday, December 21, 2009 8:46:35 PM

Rank: Premium user

Groups: Premium Users
Posts: 136
Location: Missouri, USA
great utility. Is there anyway to run against a file containing a list of pcs, instead of pointing to 1 pc? we are running into the same thing mentioned earlier where a machine has invalid characters for the 'tag' (for example, utility stopped on--> Tag: ÿÿÿÿÿ ).
Corbett
#10 Posted : Monday, December 21, 2009 9:28:22 PM

Rank: Premium user

Groups: Premium Users
Posts: 31
Location: US
googoo,
You could use a DOS for loop (http://ss64.com/nt/for_f.html) to call the utility one time for each computer in the text file.

It seems that char.IsLetter treats a ÿ as a valid letter character. I've modified the tool once again. Please try v1.3.
googoo
#11 Posted : Monday, December 21, 2009 10:06:22 PM

Rank: Premium user

Groups: Premium Users
Posts: 136
Location: Missouri, USA
that's basically what i did and it appears to be working fine (still running on list of 1800+ pcs). But thanks for the updated utility!
Corbett
#12 Posted : Tuesday, December 22, 2009 8:00:37 PM

Rank: Premium user

Groups: Premium Users
Posts: 31
Location: US
Here is a new version to handle UK dates. It should now handle both US (mm/dd/yyyy) and UK (dd/mm/yyyy) dates. It figures this out if the URL contains "euro" in it. Stuart, please let me know if this works.

04/01/2010, 1:26PM ET - Removed attachment from this post. Please download the latest version from the first post in this thread.
Stuart robinson
#13 Posted : Wednesday, December 23, 2009 4:14:38 PM

Rank: Premium user

Groups: Premium Users
Posts: 2
I can confirm that v1.4 (with the euro /US date format mod) works for our dell computers here in the UK.

pdumbleton
#14 Posted : Wednesday, December 23, 2009 6:43:54 PM

Rank: Premium user

Groups: Member, Premium Users
Posts: 19
Location: Zeeland, MI
I downloaded this but I cannot launch the application get the following error message:

This application has failed to start becuase the application configuration is incorrect. Reinstalling the application may fix this problem.

What are the requirements to run this application?
Corbett
#15 Posted : Wednesday, December 23, 2009 7:09:33 PM

Rank: Premium user

Groups: Premium Users
Posts: 31
Location: US
Off the top of my head, there are two things I can think of that may cause this issue:
1. This application requires .NET Framework 3.5 and 3.5 is not installed.
2. The UpdateDellWarrantyInfo.exe.config file is either missing or the connectionString parameter in the .config file hasn't been updated to point to the Lansweeper database.
Users browsing this topic
Guest
9 Pages123>»
Tag as favorite
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Contact: E-mail Lansweeper - Skype : Lansweeper
Copyright 2004 - 2011 © Hemoco bvba