• About me…
  • VMware
  • Powershell
  • DIY

ConfigMgr.nl

VMware, PowerShell, Automation, and more…

  • About me…
  • VMware
  • Powershell
  • DIY

Powershell – looking up HP warranty information – part 2

13 mei 2017 Powershell Script No Comments

Earlier I published a post about retrieving warranty information for HP hardware. However, the end date that is returned by the script might not always be correct!

Let me explain…

What the script does is executing a SOAP request to a website. The outcome of that request is XML data and the script returns three specific parameters:

  • ActiveEntitlement (true or false)
  • OverallEntitlementStartDate
  • OverallEntitlementEndDate

So let’s look at the outcome for a random server:

Based on the returned information warranty ends on 31-08-2017. But is that true? If I enter the same information on the HP support site I get the following data:

It looks like the powershell cmdlet returns the end date of the base warranty. But for this server a seperate support agreement is active and the actual warranty end date is 30-09-2019. So let’s see if this info is available is the returned XML data…

It is! The parameter OverallContractEndDate has the correct warranty end date. Returning this extra info is very easy. Just add one single line of code to the powershell script Get-HPEntWarrantyEntitlement.ps1. Default location is C:\Program Files\WindowsPowerShell\Modules\HPWarranty\2.6.2\Public.

Change this:

[code language=”powershell”]
[HashTable]$output = @{
‘SerialNumber’ = $SerialNumber
‘ProductNumber’ = $ProductNumber
‘ActiveEntitlement’ = $entitlement.’ISEE-GetOOSEntitlementInfoResponse’.Data.EsReply.CombinedUnitEntitlement.ActiveWarrantyEntitlement
‘OverallEntitlementStartDate’ = $entitlement.’ISEE-GetOOSEntitlementInfoResponse’.Data.EsReply.CombinedUnitEntitlement.OverallWarrantyStartDate
‘OverallEntitlementEndDate’ = $entitlement.’ISEE-GetOOSEntitlementInfoResponse’.Data.EsReply.CombinedUnitEntitlement.OverallWarrantyEndDate
}
[/code]

To this:

[code language=”powershell”]
[HashTable]$output = @{
‘SerialNumber’ = $SerialNumber
‘ProductNumber’ = $ProductNumber
‘ActiveEntitlement’ = $entitlement.’ISEE-GetOOSEntitlementInfoResponse’.Data.EsReply.CombinedUnitEntitlement.ActiveWarrantyEntitlement
‘OverallEntitlementStartDate’ = $entitlement.’ISEE-GetOOSEntitlementInfoResponse’.Data.EsReply.CombinedUnitEntitlement.OverallWarrantyStartDate
‘OverallEntitlementEndDate’ = $entitlement.’ISEE-GetOOSEntitlementInfoResponse’.Data.EsReply.CombinedUnitEntitlement.OverallWarrantyEndDate
‘OverallContractEndDate’ = $entitlement.’ISEE-GetOOSEntitlementInfoResponse’.Data.EsReply.CombinedUnitEntitlement.OverallContractEndDate
}
[/code]

Powershell - looking up HP warranty information

Upgrading to SCCM 1702

Geef een antwoord Reactie annuleren

Deze site gebruikt Akismet om spam te verminderen. Bekijk hoe je reactie-gegevens worden verwerkt.

Recente berichten
  • Copying Home Assistant configuration to GitHub
  • Handy one-liners
  • The system has insufficient locker space for the image profile
  • Testing Script Runtime Service for vSphere – part 2
  • Reporting on your Windows Server backup
Categorieën
Proudly powered by WordPress | Theme: Doo by ThemeVS.