cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Corbett
Engaged Sweeper
FYI: Lansweeper 5.0 which is currently in beta will have this feature build-in for Dell, HP, Lenovo


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:

<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.

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.
138 REPLIES 138
Slicer
Engaged Sweeper III
This script seems to be perfect for myneeds however i'm getting a proxy error:

System.ServiceModel.ProtocolException: The remote server returned an unexpected
response: (407) Proxy Authentication Required ( The ISA Server requires authoriz
ation to fulfill the request. Access to the Web Proxy filter is denied. ). --->
System.Net.WebException: The remote server returned an error: (407) Proxy Authe
ntication Required.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpCha
nnelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---


Any ideas on how to get around this?
nlee
Engaged Sweeper II
The UpdateDellWarranty and script both work like charms but it seems like they don't detect Alienware as a valid Dell model so don't update the warranty information for them. However, I know with the UpdateDellWarranty program if I manually run it with the -assetTag function for an Alienware machine it works like a charm.

Any way to add a detection for "Alienware" as a Vendor also?
chads
Lansweeper Alumni
NM Fixed it 🙂

I know this is a very old topic but thought i would try it. i downloaded the script and changed the config to match my information. it runs opens a command window nothing shows on the command window and it just closes no errors or anything. Lansweeper shows no new data though..

tried also the powershell script and that is just way over my head.

would like to get this to work.
JamesinIT
Engaged Sweeper
Thank you so much for updating the code - it is a lifesaver!
slewin
Engaged Sweeper
Hi there

Does anyone have the latest version of the script?

Thanks
mtaggart
Engaged Sweeper
Anyone know why I'm unable to get this to work? See my previous posting please ...
bpc
Engaged Sweeper
mtaggart wrote:
Anyone know why I'm unable to get this to work? See my previous posting please ...



I would recommend using version 2.0 on the first page of this thread. It has been updated and works very well. The Powershell version is excellent as well, but it has a few more prerequisites, whereas the original version is a standalone lightweight executable.

http://www.lansweeper.com/forum/resource.ashx?a=1378
mtaggart
Engaged Sweeper
Hi everyone - i'm having a problem getting this to work and would like to ask for some assistance.

Below is the error messages that I receive.

The login failure happens no matter which account that I use. So, I think that's probably what's throwing the rest of the errors.

Invoke-Sqlcmd : Login failed for user 'madixinc\cbrown'.
At C:\Users\mtaggart\Desktop\dell.ps1:16 char:24
+ $SQLQry = Invoke-Sqlcmd <<<< -SuppressProviderContextWarning -ServerInstance $SQLSVR -Database $DB -Username $User -Password $
Pwd -Query $Query
+ CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlException
+ FullyQualifiedErrorId : SqlExectionError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand

Invoke-Sqlcmd :
At C:\Users\mtaggart\Desktop\dell.ps1:16 char:24
+ $SQLQry = Invoke-Sqlcmd <<<< -SuppressProviderContextWarning -ServerInstance $SQLSVR -Database $DB -Username $User -Password $
Pwd -Query $Query
+ CategoryInfo : ParserError: (:) [Invoke-Sqlcmd], ParserException
+ FullyQualifiedErrorId : ExecutionFailureException,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand



:

Information for Service Tag
Model:
You cannot call a method on a null-valued expression.
At C:\Users\mtaggart\Desktop\dell.ps1:35 char:67
+ Write-Host "Ship Date:" $_.AssetHeaderData.SystemShipDate.ToString <<<< ('d')
+ CategoryInfo : InvalidOperation: (ToString:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Warranty End Date: 2/23/1965
UPDATE dbo.tblCompCustom SET Warrantydate = '02/23/1965 00:00:00', PurchaseDate = '' WHERE Computername = '' IF @@ROWCOUNT = 0 Ins
ert into dbo.tblCompCustom (Computername, Warrantydate, Purchasedate) Values ('', '02/23/1965 00:00:00', '')
Invoke-Sqlcmd : Login failed for user 'madixinc\cbrown'.
At C:\Users\mtaggart\Desktop\dell.ps1:49 char:14
+ Invoke-Sqlcmd <<<< -SuppressProviderContextWarning -ServerInstance $SQLSVR -Database $DB -Username $User -Password $Pwd $SQLco
mmand
+ CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlException
+ FullyQualifiedErrorId : SqlExectionError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand

Invoke-Sqlcmd :
At C:\Users\mtaggart\Desktop\dell.ps1:49 char:14
+ Invoke-Sqlcmd <<<< -SuppressProviderContextWarning -ServerInstance $SQLSVR -Database $DB -Username $User -Password $Pwd $SQLco
mmand
+ CategoryInfo : ParserError: (:) [Invoke-Sqlcmd], ParserException
+ FullyQualifiedErrorId : ExecutionFailureException,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
staadmin
Engaged Sweeper
Corbett: Thank you so much that worked great! Appreciate the help!!!!
aeneal
Engaged Sweeper
It worked great!!!! Thanks Corbett...you're awesome!!