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
"@
}
06-25-2020 08:14 PM
06-25-2020 07:57 PM
06-25-2020 08:10 PM
Richie_Rich wrote:
The following KB shows how to edit the Asset warranty URL FYI
https://www.lansweeper.com/knowledgebase/adding-manufacturer-support-links/
06-19-2020 05:01 PM
03-25-2020 12:10 PM
03-25-2020 09:55 AM
05-27-2020 03:34 PM
Martin Wildi wrote:
I do have the same Problem 😞
LanSweeper asks "https://support.hpe.com..." for Notebooks and Computers. Shouldn't this be hp.com? If i do the Check manually, i go to "https://support.hp.com/".
It's a real pain at the moment, customers rely on this information.
Thanks for fast patching.
greets
martin
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-13-2021 07:28 PM
$assets = Invoke-Sqlcmd -ServerInstance server -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
$StartDate = ((Get-HPIncWarrantyEntitlement -SerialNumber $asset.SerialNumber -ProductNumber $asset.SystemSKU).OverallEntitlementStartDate | Measure-Object -Minimum).Minimum
Write-Output "$assetID $assetName $warranty $StartDate"
Invoke-Sqlcmd -ServerInstance server -Database lansweeperdb -Username lansweeperuser -Password 'password' -Query @"
UPDATE dbo.tblAssetCustom
SET Warrantydate = '$warranty',PurchaseDate = '$StartDate'
WHERE assetID = $assetId
"@
}
08-25-2020 06:09 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now