
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2011 06:37 PM
Attached is a PowerShell script I wrote to query dbo.tblSystemEnclosure for Dell computers, pull warranty info from Dell's support site, and add it to the dbo.tblCompCustomtable, which populates the Custom fields tab in LanSweeper. This will update the purchase date, warranty date, and custom 1 field with the service type, i.e. "Next Business Day Support". I wrote this with only my environment in mind but hopefully it can help others out.
Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2012 12:25 PM
This is an excellent script but I have a small issue.
I am running this on a Windows 7 computer as I have no access to a server at this stage (in testing phase at the moment before going live).
Also, I need a way for the script to authenticate via a proxy. If you could update the code for me that would be greatly appreciated.
I am running this on a Windows 7 computer as I have no access to a server at this stage (in testing phase at the moment before going live).
Also, I need a way for the script to authenticate via a proxy. If you could update the code for me that would be greatly appreciated.
The term 'Invoke-Sqlcmd' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\xxxxxx\Desktop\Dell_WarrLSv2.ps1:15 char:24
+ $SQLQry = Invoke-Sqlcmd <<<< -Query "SELECT SerialNumber, Computername FROM lansweeperdb.dbo.tblSystemEnclosure WHERE LEN(serialnumber) = 7 AND Manufacturer LIKE 'Dell%'"
+ CategoryInfo : ObjectNotFound: (Invoke-Sqlcmd:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Exception calling "DownloadString" with "1" argument(s): "The remote server returned an error: (407) Proxy Authentication Required."
At C:\Users\biekrz3\Desktop\Dell_WarrLSv2.ps1:25 char:29
+ $HTML = $oWeb.DownloadString <<<< ($sUrl)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2011 01:22 AM
I am running LS on a Windows 2003 server; no powershell.
All I really need is something that will fill in the custom1 field with the warranty type (I'll actually change it to custom3); I have the rest already. I don't mind having the script get the rest again in order to get the warranty type, though. What can I do to run this powershell script on a server with no powershell?
Thanks,
Jono
All I really need is something that will fill in the custom1 field with the warranty type (I'll actually change it to custom3); I have the rest already. I don't mind having the script get the rest again in order to get the warranty type, though. What can I do to run this powershell script on a server with no powershell?
Thanks,
Jono

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2011 10:56 PM
pizzim13,
Care to work your magic using the Dell web service for retrieving asset warranty info? No more screen scraping...
Run like: Dell_Wrnty_WebService.ps1 "servicetag"
Output like:
Information for Service Tag ASDF1234
Model: OptiPlex 320
Entitlement: NBD ONSITE
Provided by: Unisys
Starts: 7/12/2008
Ends: 7/12/2010
Entitlement: NBD ONSITE
Provided by: Unisys
Starts: 7/13/2007
Ends: 7/12/2008
Care to work your magic using the Dell web service for retrieving asset warranty info? No more screen scraping...
Run like: Dell_Wrnty_WebService.ps1 "servicetag"
Output like:
Information for Service Tag ASDF1234
Model: OptiPlex 320
Entitlement: NBD ONSITE
Provided by: Unisys
Starts: 7/12/2008
Ends: 7/12/2010
Entitlement: NBD ONSITE
Provided by: Unisys
Starts: 7/13/2007
Ends: 7/12/2008

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2011 12:07 PM
This might also help: http://www.lansweeper.com/forum/yaf_postst2679_Update-LS-database-with-warranty-information-from-Dells-site.aspx

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2011 11:29 PM
If you only want to add the warranty infomation for new computers and not update the values for the entire table, change the value of $SQLQry from
$SQLQry = Invoke-Sqlcmd -Query "SELECT SerialNumber, Computername FROM lansweeperdb.dbo.tblSystemEnclosure WHERE LEN(serialnumber) = 7 AND Manufacturer LIKE 'Dell%'"
to
$SQLQry = Invoke-Sqlcmd -Query "SELECT SerialNumber, Computername FROM lansweeperdb.dbo.tblSystemEnclosure WHERE LEN(serialnumber) = 7 AND Manufacturer LIKE 'Dell%' AND Computername NOT IN (Select Computername from lansweeperdb.dbo.tblCompCustom)"
$SQLQry = Invoke-Sqlcmd -Query "SELECT SerialNumber, Computername FROM lansweeperdb.dbo.tblSystemEnclosure WHERE LEN(serialnumber) = 7 AND Manufacturer LIKE 'Dell%'"
to
$SQLQry = Invoke-Sqlcmd -Query "SELECT SerialNumber, Computername FROM lansweeperdb.dbo.tblSystemEnclosure WHERE LEN(serialnumber) = 7 AND Manufacturer LIKE 'Dell%' AND Computername NOT IN (Select Computername from lansweeperdb.dbo.tblCompCustom)"
