Hp serial number lookup12/5/2023 ![]() ![]() + $btnCancel = $Window.FindName(‘btnCancel’) + FullyQualifiedErrorId : InvokeMethodOnNullĪt C:\users\usgowdeyr\Desktop\Untitled2.ps1:41 char:1Īt C:\users\usgowdeyr\Desktop\Untitled2.ps1:42 char:1 + CategoryInfo : InvalidOperation: (:), RuntimeException + $txtBoxSerials = $Window.FindName(‘txtBoxSerials’) You cannot call a method on a null-valued expression.Īt C:\users\usgowdeyr\Desktop\Untitled2.ps1:40 char:1 + FullyQualifiedErrorId : MethodCountCouldNotFindBest + CategoryInfo : NotSpecified: (:), MethodException Multiple ambiguous overloads found for “Load” and the argument count: “1”.Īt C:\users\usgowdeyr\Desktop\Untitled2.ps1:38 char:1 + FullyQualifiedErrorId : CannotFindAppropriateCtor, + CategoryInfo : ObjectNotFound: (:), PSArgumentException Cannot find an appropriate constructor for type .Īt C:\users\usgowdeyr\Desktop\Untitled2.ps1:37 char:10 New-Object : A constructor was not found. + FullyQualifiedErrorId : InvalidCastToXmlDocument + CategoryInfo : InvalidArgument: (:), RuntimeException Line 3,Īt C:\users\usgowdeyr\Desktop\Untitled2.ps1:13 char:1 So I have now uploaded the script to Microsoft Script Center, here WordPress adding/stripping characters and WordPress not supporting uploading ps1 file types. There have been so many comments added to this blog post regarding issues with the script. Write-Host "Error encountered submitting bulk warranty request, description: $($), process will terminate" -ForegroundColor Red Write-Host "Error encountered retrieving results for job id: $($jobId), description: $($_.), status code: $($_._), process will terminate" -ForegroundColor Red Start-Process -FilePath Excel -ArgumentList "`"$($tempFileName).csv`"" -ErrorAction Silentl圜ontinue Write-Host "Opening CSV file in Excel: $($tempFileName).csv" -ForegroundColor Green $result | Export-Csv -Path "$($tempFileName).csv" -NoTypeInformation Write-Host "Saving results to CSV file: $($tempFileName).csv" -ForegroundColor Green Remove-Item $tempFileName -Recurse -Force -ErrorAction Silentl圜ontinue ![]() $result = Invoke-RestMethod -Method Get -Uri "$($jobId)/results" -ContentType "application/json" -Headers $headers Write-Host "Job status for job id: $($jobId) is complete, retrieving results" -ForegroundColor Green If($_ -notmatch "^\w+$") until ($result.status -and $result.status -notlike "*progress*") $btnCancel = $Window.FindName('btnCancel') $txtBoxSerials = $Window.FindName('txtBoxSerials') The full script is below, WordPress doesn’t like XML tags in the code so the content between the two and symbols is not displayed and should be as below:Īdd-Type –assemblyName PresentationFramework Īdd-Type -AssemblyName If Microsoft Excel is installed, the CSV will be opened, as an example, content is below. Once the process is complete and the results requested they will be saved to a temporary CSV file as shown above. The limit can be increased by request to HP but will need justification. If it takes a long time, 5000 will, it could use up the 100 call limit before the results can be requested. The script will use a call for submitting the job, a call for each query of the job status and a call for requesting the results. This time could be decreased, however the API has a call limit of 100 per day. This script is therefore set to query the job status every 5 minutes until complete. It is then required that the job status is queried until complete, at which point the results can be requested. The way the API works for bulk requests is that a request is submitted, a job ID provided. Once you click OK, progress will be echoed to the command line as shown below. The API documentation states both a serial number and product number should be supplied for each product, however the product number is not easily available and I found positives results are still provided without. Upon execution of the script a list box is displayed, you can enter up to 5000 serial numbers (API maximum), each on a new line. The full script is at the bottom of the post. The $apiKey and $apiSecret should be entered in the Param section below or specified as parameters on execution. Once approved you will be able to click on the app in the list of My Apps, where you will find your API Key and API Secret, both required to use the script. In order to use the below PowerShell script/form you will need to have or create an account here then navigate to My Apps, add a new app for HP Product Warranty and await approval. HP do provide a Product Warranty API available on application for developer account members here. The warranty details can be checked manually here or up to 20 here however the details have to be manually entered individually, you can’t just copy and paste a bunch of serial numbers. ![]() You may have a requirement to mass check the product warranty details of HP products. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |