11-21-2019 11:12 AM
Solved! Go to Solution.
02-21-2020 01:52 PM
$assets = Invoke-Sqlcmd -ServerInstance servername -Database lansweeperdb -Username lansweeperuser -Password 'password' -Query @"
SELECT a.AssetID, a.AssetName, b.Serialnumber, b.SystemSKU
FROM lansweeperdb.dbo.tblAssets a, lansweeperdb.dbo.tblAssetCustom b
WHERE a.AssetID = b.AssetID AND
a.Assettype = -1 AND
b.Warrantydate is NULL AND
b.Manufacturer in ('HP','Hewlett-Packard');
"@
foreach ($asset in $assets) {
$assetId = $asset.AssetID
$assetName = $asset.AssetName
$warranty = ((Get-HPIncWarrantyEntitlement -SerialNumber $asset.SerialNumber -ProductNumber $asset.SystemSKU).OverallEntitlementEndDate | Measure-Object -Maximum).Maximum
Write-Output "$assetID $assetName $warranty"
Invoke-Sqlcmd -ServerInstance servername -Database lansweeperdb -Username lansweeperuser -Password 'password' -Query @"
UPDATE dbo.tblAssetCustom
SET Warrantydate = '$warranty'
WHERE assetID = $assetId
"@
}
01-21-2020 04:11 AM
Please note: The beta Warranty API is currently unavailable.
We will resume operations at a later time.
For small numbers of devices, please consider HP Support's manual Warranty Checking web form.
01-21-2020 03:29 AM
01-09-2020 11:26 AM
01-08-2020 02:37 AM
01-03-2020 08:39 AM
12-12-2019 03:17 PM
03-02-2020 07:14 AM
Esben.D wrote:
I've checked further and there is a known issue with retrieving warranty data from HP devices. The HP API has been down for a while and our fallback method of scraping the website, unfortunately, is non-functional currently as well due to changes at the end of HP. We're currently in contact with HP to try to get a more permanent resolution here, to hopefully set up reliable warranty retrieval via API (as we do for Dell).
Unfortunately, as we're reliant on a 3rd party, slowing down the process, it's difficult to give an estimate on when we can resolve this.
12-11-2019 02:10 AM
12-11-2019 12:14 AM
12-10-2019 12:30 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now