Jump to content
DarrenDK

Computer Warranty Updater (HP/Dell/Lenovo)

Recommended Posts

Not sure if this affects the scripts:

 

Our records indicate your company is enrolled in our Dell EMC TechDirect APIs service.  You are requested to complete updates within tools using these APIs by December 15, 2019 to avoid interruptions in service.

 

What’s happening?

We are making security enhancements to the following TechDirect APIs: Warranty Management, Self-Dispatch and Technical Support Requests.  These changes require updates within your application environment. 

 

Where can I find details of the API changes?

Please log into your TechDirect account to view the updated technical specifications (SDK) documents for the APIs your organization uses. The required code changes are clearly highlighted. 

 

Having difficulty accessing your account? From TechDirect.com, click “Sign in”.  Then, select “Forgot password?” to receive an email with an active password link.

 

What actions do I need to take prior to December 15, 2019?

1.  Implement code changes per updated SDK documentation. We recommend getting started as soon as possible. 

2.  Retrieve your updated credentials available from August 19th on the TechDirect portal.

3.  Test your API updates using the sandbox API from August 19th onwards.

4.  Update your environment prior to December 15, 2019 to avoid interruptions for applications leveraging TechDirect APIs. 

We look forward to continuing to work with you in the TechDirect portal.  If you have any questions or need assistance, please email us at APIs_TechDirect@Dell.com.

 

Thank you,

Dell EMC TechDirect API Team

Share this post


Link to post
Share on other sites
On 7/10/2018 at 6:25 AM, DarrenDK said:
  • Open Immense Networks Scripts->Update-MissingWarranties, copy the value of the PowershellCode variable into Powershell ISE on the LabTech server and run it.
    1. There should be no errors about script execution or modules not found. You may get a rate limit error from the API, but that's relatively normal. 
  • Open your _System Automation->Onboarding->Initial System Configuration - Partner Script and insert a Script Run step that runs the Immense networks Scripts->Update-MissingWarranties script

Hi @DarrenDK,

Would you please let me know how i should run these two steps?

Thanks

Share this post


Link to post
Share on other sites

I just tried implementing this, and the Dell and Lenovo work out of the box!  However, I am getting an error with the HP one when I run it in PowerShell ISE.

Get-HPWarrantyInfo : Cannot bind argument to parameter 'AccessToken' because it is null.
At line:473 char:135
+ ... ret $HPAPISecret -SerialNumbers $LookupInfo -AccessToken $AccessToken
+                                                              ~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-HPWarrantyInfo], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Get-HPWarrantyInfo

Am I missing a step?  Or did something break or a Syntax change with the HP API?

Thanks!

Share this post


Link to post
Share on other sites

Yeah, still getting the error, but after doing some additional research, it does look like the HP API is currently broken, and has been since May of 2019.  All the HP warranty tools are having the same issue.

Thanks for everything, this is a very nice Labtech script!

Share this post


Link to post
Share on other sites

Amazing work! @DarrenDK 

When running this script, I get warranty information, which doesn't coincide with the information, when making a lookup at Lenovo - or at least, there some warranty missing.

For example, when looking up my own computer with serial PC0A51B2, I get the following information from the script:

Purchase date (dd/mm/yyyy): 18/02/2016
Expiration date: (dd/mm/yyyy): 03/04/2017

However when looking up the computer at Lenovo, it says:

image.png.a6a7837aa9bcc411a81d16c9c127adbe.png

As you can see, if there is extended warranty purchased for the product, it's missing in the data received from the script... the script seems only to be able to extract the factory warranty. We have other computers, which have 3 years factory warranty, but have 2 years additional warranty purchased. This 'extended' warranty is not received from the script... 

Can something be done about this, or is this 'just' a limitation? What data do you receive from the REST API request?

Thanks again.

Share this post


Link to post
Share on other sites

So has anybody worked out an alternative for the HP API? Is there even one? I've reached out to our account manager today but can't see that being any help.

 

 

Share this post


Link to post
Share on other sites

I seem to have fixed it, by some trial and error. 

Made some modifications to the powershell script, so it catches both extended warranties AND non-extended (purchased-extended) warranties now. 
This is only for Lenovo computers.

Thanks again, @DarrenDK for this. 

Share this post


Link to post
Share on other sites
13 minutes ago, Anders Bermann said:

I seem to have fixed it, by some trial and error. 

Made some modifications to the powershell script, so it catches both extended warranties AND non-extended (purchased-extended) warranties now. 
This is only for Lenovo computers.

Thanks again, @DarrenDK for this. 

If you post your changes, I'm happy to update the original

 

Did your changes happen to fix the HP stuff or just the Lenovo extended warranty situation?

Share this post


Link to post
Share on other sites
1 hour ago, DarrenDK said:

If you post your changes, I'm happy to update the original

 

Did your changes happen to fix the HP stuff or just the Lenovo extended warranty situation?

This is only for Lenovo.

Within the webresponse variable, there's a value which is being queried, which makes up the warranty end-date. 

Basically I query two variables instead of one. After exporting the webresponse as XML, I analyzed it, and found that there are two variable (depending on whether there's extended warranty or not) being filled. 

The first one is: 

$webresponse.wiOutputForm.warrantyInfo.serviceInfo.wed | select -first 1

That one, is the factory warranty. But after looking at the XML file, I found that there's another one too. That one is found by querying a bit different:

$webresponse.SelectSingleNode("//mEndDate") | Select-Object -ExpandProperty `#text

After finding this, I realised, that the mEndDate is only set, if extended warranty is present. So I made a simple if-else statement, to check for $null value:

        $WarrantyEndDate_Expanded = $webresponse.SelectSingleNode("//mEndDate") | Select-Object -ExpandProperty `#text

        if ($WarrantyEndDate_Expanded -eq $null) {

            $WarrantyEndDate_Expanded = $webresponse.wiOutputForm.warrantyInfo.serviceInfo.wed | select -first 1

        }

I have uploaded a text file for the updated Function: Get-LenovoWarrantyInfo. 
When updating the original script, just replace the function with the modified one :)

The only changed made, is written above. 

Thanks again for your work.

Updated_Get-LenovoWarrantyInfo.txt

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...