Jump to content
DarrenDK

Computer Warranty Updater (HP/Dell/Lenovo)

Recommended Posts

I have taken the recent updates and reworked the original script with the posted updates.  You should be able to copy and past this code into a text file and name it somthing.ps1 then update any required fields (the Dell API) and run it on your labtech server.  It does require the LabTech module from the beginning of this thread.  I am still waiting on my Dell API keys so I can't say if that part works yet, but as long as you install the HPwarranty Powershell module (Install-Module -Name HPWarranty) on your labtech server, The HP part seems to work well.  It successfully update over 850 HP warranties in my labtech server.  Now that said, I am not a programmer, and have just taken all the posted information in this thread and reworked it.  If someone with a Dell API can test that part and review the code, that would be great.  I cannot take any credit for this working, so thanks to everyone who has posted the code, and feel free to make if better or let me know if I have something wrong.

Import-Module LabTech
Connect-LTDatabase
Add-Type -AssemblyName System.Web
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
add-type @"
    using System.Net;
    using System.Security.Cryptography.X509Certificates;
    public class TrustAllCertsPolicy : ICertificatePolicy {
        public bool CheckValidationResult(
            ServicePoint srvPoint, X509Certificate certificate,
            WebRequest request, int certificateProblem) {
            return true;
        }
    }
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy

function Split-array 
{

<#  
  .SYNOPSIS   
    Split an array
  .NOTES
    Version : July 2, 2017 - implemented suggestions from ShadowSHarmon for performance   
  .PARAMETER inArray
   A one dimensional array you want to split
  .EXAMPLE  
   Split-array -inArray @(1,2,3,4,5,6,7,8,9,10) -parts 3
  .EXAMPLE  
   Split-array -inArray @(1,2,3,4,5,6,7,8,9,10) -size 3
#> 

  param($inArray,[int]$parts,[int]$size)
  
  if ($parts) {
    $PartSize = [Math]::Ceiling($inArray.count / $parts)
  } 
  if ($size) {
    $PartSize = $size
    $parts = [Math]::Ceiling($inArray.count / $size)
  }

  $outArray = New-Object 'System.Collections.Generic.List[psobject]'

  for ($i=1; $i -le $parts; $i++) {
    $start = (($i-1)*$PartSize)
    $end = (($i)*$PartSize) - 1
    if ($end -ge $inArray.count) {$end = $inArray.count -1}
	$outArray.Add(@($inArray[$start..$end]))
  }
  return ,$outArray

}

Function Invoke-LenovoWarrantyRESTAPI {
[CmdletBinding()]

    param
    (
        #Specifies the Lenovo serial number
        [Parameter(Mandatory = $true,
        Position = 0 )]
        [Alias('SN')]
        [string]
        $SerialNumber,

        [Parameter(Mandatory = $false)]
        [Alias('Model')]
        $Product = ""
    )

    $url = "https://ibase.lenovo.com/POIRequest.aspx"
    $verb = "POST"

    $header = @{ "Content-Type" = "application/x-www-form-urlencoded" }

    $body = [xml]"<wiInputForm source='ibase'><id>LSC3</id><pw>IBA4LSC3</pw><product></product><serial></serial><wiOptions><machine/><parts/><service/><upma/><entitle/></wiOptions></wiInputForm>"
    $body = "xml=<wiInputForm source='ibase'><id>LSC3</id><pw>IBA4LSC3</pw><product>$Product</product><serial>$SerialNumber</serial><wiOptions><machine/><parts/><service/><upma/><entitle/></wiOptions></wiInputForm>"

    $response = Invoke-RestMethod -Method $verb -Uri $url -Body $body -Headers $header

    return $response
}

Function Get-LenovoWarrantyInfo {
[CmdletBinding(DefaultParameterSetName="ByComputerName")]

    param (

        #Specifies the Lenovo serial number
        [Parameter(Mandatory = $true,
        ValueFromPipelineByPropertyName = $true,
        ValueFromPipeline = $true,
        Position = 0,
        ParameterSetName="BySerialNumber")]
        [Alias('SN')]
        [string]$SerialNumber,

        #Lenovo Product Code for device being queried
        [Parameter(Mandatory = $false,
        ValueFromPipelineByPropertyName = $true,
        ValueFromPipeline = $true,
        Position = 1,
        ParameterSetName = "BySerialNumber")]
        [string]
        $Product,

        [Parameter(Mandatory = $false,
        ValueFromPipelineByPropertyName = $true,
        ValueFromPipeline = $true,
        Position = 0,
        ParameterSetName = "ByComputerName")]
        [string]
        $ComputerName,

        [Parameter(Mandatory = $false,
        ParameterSetName = "ByComputerName")]
        [System.Management.Automation.CredentialAttribute()]
        $Credential
        
    )

    $RESTParams =@{}

    switch($PsCmdlet.ParameterSetName)
    {
        "BySerialNumber"
        {
            $RESTParams.Add("SerialNumber", $SerialNumber)

            if (!([string]::IsNullOrWhiteSpace($Product))) { $RESTParams.Add("Product", $Product) }
        }
        
        "ByComputerName"
        {
            # need to use WMI to lookup serial number and model number of device
            
            $args = @{ namespace = "root\cimv2"
                        class = "Win32_SystemEnclosure"
                        ErrorAction = "SilentlyContinue"}

            if (!([string]::IsNullOrEmpty($ComputerName)))
            {
                $args.Add("ComputerName", $ComputerName)
            }

            if (!([string]::IsNullOrEmpty($Credential)))
            {
                $args.Add("Credential", $Credential)
            }

            $result = Get-WmiObject @args

            if ($result -eq $null)
            {
                Write-Error "Unable to retrieve Serial Number from computer '$computername'"
                Exit
            } 
            else 
            {
                $RESTParams.Add("SerialNumber", ($result | Select-Object -ExpandProperty SerialNumber ))

                $args["Class"] = "Win32_ComputerSystem"

                $result = Get-WmiObject @args


                $Manufacturer = $result | Select-Object -ExpandProperty Manufacturer

                if ($Manufacturer -notmatch "Lenovo")
                {
                    Write-Warning "Possibly not a Lenovo device"
                }
                else
                {
                    $RESTParams.Add("Product", ($result | Select-Object -ExpandProperty Model ))
                }
            }
        }
    }

    $webresponse = Invoke-LenovoWarrantyRESTAPI @RESTParams

    if ($null -eq $webresponse) 
    {
        Write-Error "REST API returned NULL"
    }
    else
    {
        #REST API returned data

        $properties = @{}

        if ($webresponse.SelectSingleNode("//serviceInfo")) {

            $properties.Add("ShipDate", ($webresponse.wiOutputForm.warrantyInfo.serviceInfo.shipDate | select -first 1))
            $properties.Add("WarrantyStartDate", ($webresponse.wiOutputForm.warrantyInfo.serviceInfo.warstart | select -first 1))
            $properties.Add("WarrantyEndDate", ($webresponse.wiOutputForm.warrantyInfo.serviceInfo.wed | select -last 1))
        } else {
            $properties.Add("ShipDate", $null)
            $properties.Add("WarrantyStartDate", $null)
            $properties.Add("WarrantyEndDate", $null)
        }


        if ($webresponse.SelectSingleNode("//machineInfo")) {

            $properties.Add("Model", $webresponse.wiOutputForm.warrantyInfo.machineinfo.model)
            $properties.Add("Type", $webresponse.wiOutputForm.warrantyInfo.machineinfo.type)
            $properties.Add("Product", $webresponse.wiOutputForm.warrantyInfo.machineinfo.product)
            $properties.Add("SerialNumber", $webresponse.wiOutputForm.warrantyInfo.machineinfo.serial)
        }
        
        if ($webresponse.SelectSingleNode("//wiInputForm/xmlMessages")) 
        {

            $errorMessage = $webresponse.wiInputForm.xmlMessages.xmlMessage | Where-Object {$_.type -eq "error"}

            if ( $errorMessage -ne $null  ) {
                $properties.Add("ErrorNumber",($errorMessage.num))
                $properties.Add("ErrorText", ($errorMessage.InnerText))

            }
        }
    }

    $WarrantyInfo = New-Object psobject -Property $properties

    $WarrantyInfo    
}

Function Get-DellWarrantyInfo
{
	Param(
	[Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
    [Array]$ServiceTags,
    [Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
    [Array]$AccessToken
	)
	
    $AuthHeader = @{Authorization="Bearer $AccessToken"}

    $JobResponse = Invoke-RestMethod -Method Get -Uri "https://apigtwb2c.us.dell.com/PROD/sbil/eapi/v5/asset-entitlements?servicetags=$ServiceTags" -headers $AuthHeader -ContentType 'application/json'

    $AllComputerWarranties = $JobResponse | ?{ $_.entitlements } | %{
           $ThisComputerApiResponse = $_
           $ShipDate = $ThisComputerApiResponse.shipDate
           $ThisComputerWarranties = $ThisComputerApiResponse.entitlements | ?{ $_.ServiceLevelCode -notlike "D" }
           $WarrantyStart = $ThisComputerWarranties | sort startDate | Select -First 1 -ExpandProperty startDate
           $WarrantyEnd = $ThisComputerWarranties | sort EndDate | Select -Last 1 -ExpandProperty endDate
           if(-not [String]::IsNullOrEmpty($ShipDate) -and -not [String]::IsNullOrEmpty($WarrantyEnd))
           {
            New-Object psobject -Property @{"WarrantyEndDate"=[DateTime]::Parse($WarrantyEnd.SubString(0,10));"ShipDate"=[DateTime]::Parse($ShipDate.SubString(0,10));"SerialNumber"=$_.ServiceTag}         
           }
           else
           {
            Write-Warning "Invalid Warranty Info received for ServiceTag: $($ThisComputerApiResponse.ServiceTag) ShipDate: $ShipDate WarrantyEnd: $WarrantyEnd `r`n$($ThisComputerWarranties)"
           }
        }

    $AllComputerWarranties
}

Function Update-WarrantyInLabTech
{
Param(
	[Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
	$ComputerID,
    [Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
	[DateTime]$ShipDate,
    [Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
	[DateTime]$WarrantyEndDate
	)

    try
    {
        Write-Output "Updating ComputerID: $ComputerID ShipDate: $ShipDate EndDate: $WarrantyEndDate"
        Assert-LabtechQuery -query "update Computers set WarrantyEnd='$($WarrantyEndDate.ToString("yyyy-MM-dd"))', AssetDate='$($ShipDate.ToString("yyyy-MM-dd"))' where ComputerID=$ComputerID;" | Out-Null
    }
    catch
    {
        $_
    }

}

Function Update-MissingDellWarranties
{
	Param(
	[Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
	[string]$DellClientId,
    [Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
	[string]$DellClientSecret
	)

	$ComputersMissingWarranty = Get-LabtechData -Query "select ComputerID, BiosVer, (case WarrantyEnd when '0000-00-00 00:00:00' then '1979-01-01' else WarrantyEnd end) as 'WarrantyEnd' from computers where BiosMFG = 'Dell' and length(trim(BiosVer)) = 7 and (WarrantyEnd='0000-00-00 00:00:00' or assetdate > WarrantyEnd)"
	
    if($ComputersMissingWarranty.Count -eq 0)
    {
        "No Dell computers missing warranty"
        return
    }

    $uri = "https://apigtwb2c.us.dell.com/auth/oauth/v2/token"

    if(-not $AccessToken)
    { 
        $AuthResponse = Invoke-RestMethod -Method Post -Uri $uri -Body "client_id=$DellClientID&client_secret=$DellClientSecret&grant_type=client_credentials" -ContentType "application/x-www-form-urlencoded"
        if(-not $AuthResponse)
        {
            "Dell API timed out while obtaining access token. Plese try again later"
            return
        }
        $AccessToken = $AuthResponse | select -ExpandProperty access_token
    }

    Write-Host "AccessToken: $AccessToken"

    $Chunks = Split-Array -inArray $ComputersMissingWarranty -size 100

    foreach($Chunk in $Chunks){
        $WarrantyInfoArray = @()
        $WarrantyInfoArray += Get-DellWarrantyInfo -ServiceTags $($Chunk.BiosVer -join ',') -AccessToken $AccessToken
        $WarrantyInfoArray | %{
            $WarrantyInfo = $_
            $ComputerID = $ComputersMissingWarranty | ?{$_.biosver -like $WarrantyInfo.SerialNumber} | select -first 1 -ExpandProperty ComputerID
            Update-WarrantyInLabTech -ComputerID $ComputerID -ShipDate $WarrantyInfo.ShipDate -WarrantyEndDate $WarrantyInfo.WarrantyEndDate
        }
    }
}

Function Update-MissingLenovoWarranties
{
    Param(
	[Parameter(
	Mandatory = $false,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
	[string]$LenovoAPIKey
	)
    $ComputersMissingWarranty = Get-LabtechData -query "select ComputerID, BiosVer, (case WarrantyEnd when '0000-00-00 00:00:00' then '1979-01-01' else WarrantyEnd end) as 'WarrantyEnd' from computers where biosmfg like 'lenovo' and (warrantyend = 0 or assetdate = 0)"
    Write-Host "Submitting $($ComputersMissingWarranty.Count) computers to Lenovo API: $(($ComputersMissingWarranty.BiosVer) -Join ",")"
    
    #$info = Get-LenovoWarrantyInfo -SerialNumber '1045680901618' -Product 20428
    #$LenovoWarrantyInfo = @();
    $ComputersMissingWarranty | %{
        $WarrantyInfo = Get-LenovoWarrantyInfo -SerialNumber $_.BiosVer -Product $_.BiosName
        $WarrantyInfo | Add-Member -NotePropertyName "ComputerID" -NotePropertyValue $_.ComputerID
        
        $ComputerID = $_.Computerid
        if([String]::IsNullOrEmpty($warrantyinfo.WarrantyEndDate) -eq $false -and [String]::IsNullOrEmpty($WarrantyInfo.ShipDate) -eq $false)
        {
            $EndDate = [DateTime]::Parse($WarrantyInfo.WarrantyEndDate)
            $ShipDate = [DateTime]::Parse($WarrantyInfo.ShipDate)
            Update-WarrantyInLabTech -ComputerID $_.ComputerID -ShipDate $ShipDate -WarrantyEndDate $EndDate
        }
        else
        {
            Write-Host "Lenovo response missing data for Serial Number: $($_.BiosVer) ShipDate: $($WarrantyInfo.ShipDate) EndDate: $($WarrantInfo.WarrantyEndDate)"
        }
    }
}

Function Update-MissingHPWarranties
{   

    $HPComputers = Get-LabtechData -query "select ComputerID, BiosVer sn, (case WarrantyEnd when '0000-00-00 00:00:00' then '1979-01-01' else WarrantyEnd end) as 'WarrantyEnd', inv_chassis.SKUNumber pn from computers join inv_chassis using(computerid) where BiosMFG like 'h%p%' and (WarrantyEnd='0000-00-00 00:00:00' or assetdate > WarrantyEnd)"
    "$($HPComputers.Count) HP computers found in need of warranty information"  
    
    
    for($i=0;$i -lt $HPComputers.Count;$i++)
        {
            $WarrantyInfo = Get-HPIncWarrantyEntitlement -SerialNumber $HPComputers[$i].sn -ProductNumber $HPComputers[$i].pn
                        
            if($WarrantyInfo.OverallEntitlementStartDate -ne $null)
                {
                    try
                    {
                        if(($WarrantyInfo.OverallEntitlementEndDate | Measure-Object).Count -gt 1)
                            {
                                $end = $([DateTime]::Parse($WarrantyInfo.OverallEntitlementEndDate[0]))
                            }else{
                                $end = $([DateTime]::Parse($WarrantyInfo.OverallEntitlementEndDate))
                            }

                        if(($WarrantyInfo.OverallEntitlementStartDate | Measure-Object).Count -gt 1)
                            {
                                $start = $([DateTime]::Parse($WarrantyInfo.OverallEntitlementStartDate[0]))
                            }else{
                                $start = $([DateTime]::Parse($WarrantyInfo.OverallEntitlementStartDate))
                            }


                        Update-WarrantyInLabTech -ComputerID $HPComputers[$i].ComputerID -ShipDate $start -WarrantyEndDate $end -ErrorAction Stop
                    }
                    catch
                    {
                        Write-Output "Error updating $($HPComputers[$i].ComputerID): End date: $end"
                    }
                }
                else
                {
                    Write-Output "No Warranty Info returned for $($HPComputers[$i].ComputerID)"
                }
        }
        
        
     
}
    
$DellClientId = 'DellClientID'
$DellClientSecret = 'DellClientSecret'

Write-Host "Trimming SerialNumbers"
Assert-LabtechQuery "update computers set BiosVer=trim(BiosVer) where BiosVer like ' %' or BiosVer like '% '" | out-null
Write-Host "Updating Dell Warranties"
Update-MissingDellWarranties -DellClientId $DellClientId -DellClientSecret $DellClientSecret
Write-Host "Updating Lenovo Warranties"
Update-MissingLenovoWarranties
Write-Host "Updating HP Warranties"
Update-MissingHPWarranties

Derek

Share this post


Link to post
Share on other sites

Hi @drpugh - thank you for spending more time on this. I think I have the Dell working now which is awesome! Can you elaborate on the HP Powershell module as this is failing when I try import it. What are the steps I need to take?

Share this post


Link to post
Share on other sites

I just got my Dell API keys this morning, and that part worked great as well.  Thanks again to @Joe.McCall for posting the HP Code for the HPWarranty powershell module, and the updated Dell Code!
@Rob Leverton  You need to install the HPWarranty Powershell Module on the Labtech/automate server.  You will be prompted to install NuGet as well since it's needed to download the module.

Install-Module -Name HPWarranty

If you get a "WARNING: Unable to download from URI" error, that is a TLS error, and can worked around by running the following command to upgrade an open powershell session to TLS 1.2, and re-running the original install command.  There are guides out there on how to modify the powershell TLS protocols, but this will get you up and running.

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Hope that helps.

Share this post


Link to post
Share on other sites

Thanks @drpugh - Nuget is installed but I get this when trying to run the install command in Powershell ISE

 

PS C:\Users\Administrator> Install-Module -Name HPWarranty
Install-Module : The term 'Install-Module' is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
again.
At line:1 char:1
+ Install-Module -Name HPWarranty
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Install-Module:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 

PS C:\Users\Administrator> 

Share this post


Link to post
Share on other sites
Posted (edited)

Where does one acquire a Lenovo API Key?

Also - HP is telling me that their API is still down, so I don't have a key for that, either.  All HP checks are coming back with blank dates - so, either all HP's are without warranty, or the key is still necessary (despite the API being down), or (and, I can assure you, this is much more likely) I'm an idiot.

These are all really awesome functions - I'm glad you guys exist.  The powers that be want Warranty Reporting, but they don't want to pay for it, and I'm sooo very tired of activating Warranty Master, and then having to cancel it right away.

Anywho - I'm trying to get something working that will work without being so "LabTech-Specific".  And I'm just finishing up with the Dell portion (got the keys last week, so I've been able to test).  I just need the Lenovo and HP keys, I reckon.  (And, this is probably a longshot...but does anyone know if any of the other guys are going this route - i.e. Microsoft, Apple, Sony, Acer, etc.)

The goal is to clean up our ConnectWise Configuration Objects.  I don't know what it is about techs, man - but we have just...an absurd amount of duplicates, incorrect entries, randomly-named entries, entries that are under the wrong companies, you name it.  I keep telling people: "You don't have to add a Configuration Object for a Server or a Workstation - LabTech will do that for you."  Yet...like clockwork...

Oh, well - hopefully this will work.  You guys are friggin rock-stars, can't thank you enough (or, really - this whole community enough - but, right now...it's all you guys) for helping me with the pieces to these never ending puzzles.

EDIT - Ok, so I guess Keys aren't really necessary for HP/Lenovo?  Though, the Get-HPEntWarrantyEntitlement is now coming back with a DNS error:

Exception calling "GetRequestStream" with "0" argument(s): "The remote name could not be resolved: 'services.isee.hp.com'"
At C:\Program Files\WindowsPowerShell\Modules\HPWarranty\2.6.2\Private\Invoke-HPEntSOAPRequest.ps1:77 char:14
+             ($requestStream = $soapWebRequest.GetRequestStream())
+              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

Wasn't sure if others were experiencing this, or if it was just me.

Edited by Seth

Share this post


Link to post
Share on other sites

Thank you for the warranty lookup script, I have it working for HP Workstations, but not tested with a server just yet - you need to open an elevated powershell on the Labtech server and run the following one time before it works for HP.

Install-Module -Name HPWarranty

My contribution back is I have added scripts for Dynabook/Toshiba and Microsoft Corporation - Replace the script posted by DrPugh with the one below.

Dynabook warranty lookup was easy enough.

Microsoft was a tricky one, I used the Surface Diagnostic Toolkit on a Microsoft Device to look up its own warranty whilst capturing with Wireshark. I saw it negotiate a TLS connection with "surfacewarrantyservice.azurewebsites.net" I googled this and it returned Kelvin Tegelaar's blog here. https://www.cyberdrain.com/automating-with-powershell-automating-warranty-information-reporting/ 

So I have adapted his script to suit this application.

Drop this entire script over the one DrPugh posted above and remember to replace your Dell API key if you have one.

Import-Module LabTech
Connect-LTDatabase
Add-Type -AssemblyName System.Web
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
add-type @"
    using System.Net;
    using System.Security.Cryptography.X509Certificates;
    public class TrustAllCertsPolicy : ICertificatePolicy {
        public bool CheckValidationResult(
            ServicePoint srvPoint, X509Certificate certificate,
            WebRequest request, int certificateProblem) {
            return true;
        }
    }
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy

function Split-array 
{

<#  
  .SYNOPSIS   
    Split an array
  .NOTES
    Version : July 2, 2017 - implemented suggestions from ShadowSHarmon for performance   
  .PARAMETER inArray
   A one dimensional array you want to split
  .EXAMPLE  
   Split-array -inArray @(1,2,3,4,5,6,7,8,9,10) -parts 3
  .EXAMPLE  
   Split-array -inArray @(1,2,3,4,5,6,7,8,9,10) -size 3
#> 

  param($inArray,[int]$parts,[int]$size)
  
  if ($parts) {
    $PartSize = [Math]::Ceiling($inArray.count / $parts)
  } 
  if ($size) {
    $PartSize = $size
    $parts = [Math]::Ceiling($inArray.count / $size)
  }

  $outArray = New-Object 'System.Collections.Generic.List[psobject]'

  for ($i=1; $i -le $parts; $i++) {
    $start = (($i-1)*$PartSize)
    $end = (($i)*$PartSize) - 1
    if ($end -ge $inArray.count) {$end = $inArray.count -1}
	$outArray.Add(@($inArray[$start..$end]))
  }
  return ,$outArray

}

Function Invoke-LenovoWarrantyRESTAPI {
[CmdletBinding()]

    param
    (
        #Specifies the Lenovo serial number
        [Parameter(Mandatory = $true,
        Position = 0 )]
        [Alias('SN')]
        [string]
        $SerialNumber,

        [Parameter(Mandatory = $false)]
        [Alias('Model')]
        $Product = ""
    )

    $url = "https://ibase.lenovo.com/POIRequest.aspx"
    $verb = "POST"

    $header = @{ "Content-Type" = "application/x-www-form-urlencoded" }

    $body = [xml]"<wiInputForm source='ibase'><id>LSC3</id><pw>IBA4LSC3</pw><product></product><serial></serial><wiOptions><machine/><parts/><service/><upma/><entitle/></wiOptions></wiInputForm>"
    $body = "xml=<wiInputForm source='ibase'><id>LSC3</id><pw>IBA4LSC3</pw><product>$Product</product><serial>$SerialNumber</serial><wiOptions><machine/><parts/><service/><upma/><entitle/></wiOptions></wiInputForm>"

    $response = Invoke-RestMethod -Method $verb -Uri $url -Body $body -Headers $header

    return $response
}

Function Get-LenovoWarrantyInfo {
[CmdletBinding(DefaultParameterSetName="ByComputerName")]

    param (

        #Specifies the Lenovo serial number
        [Parameter(Mandatory = $true,
        ValueFromPipelineByPropertyName = $true,
        ValueFromPipeline = $true,
        Position = 0,
        ParameterSetName="BySerialNumber")]
        [Alias('SN')]
        [string]$SerialNumber,

        #Lenovo Product Code for device being queried
        [Parameter(Mandatory = $false,
        ValueFromPipelineByPropertyName = $true,
        ValueFromPipeline = $true,
        Position = 1,
        ParameterSetName = "BySerialNumber")]
        [string]
        $Product,

        [Parameter(Mandatory = $false,
        ValueFromPipelineByPropertyName = $true,
        ValueFromPipeline = $true,
        Position = 0,
        ParameterSetName = "ByComputerName")]
        [string]
        $ComputerName,

        [Parameter(Mandatory = $false,
        ParameterSetName = "ByComputerName")]
        [System.Management.Automation.CredentialAttribute()]
        $Credential
        
    )

    $RESTParams =@{}

    switch($PsCmdlet.ParameterSetName)
    {
        "BySerialNumber"
        {
            $RESTParams.Add("SerialNumber", $SerialNumber)

            if (!([string]::IsNullOrWhiteSpace($Product))) { $RESTParams.Add("Product", $Product) }
        }
        
        "ByComputerName"
        {
            # need to use WMI to lookup serial number and model number of device
            
            $args = @{ namespace = "root\cimv2"
                        class = "Win32_SystemEnclosure"
                        ErrorAction = "SilentlyContinue"}

            if (!([string]::IsNullOrEmpty($ComputerName)))
            {
                $args.Add("ComputerName", $ComputerName)
            }

            if (!([string]::IsNullOrEmpty($Credential)))
            {
                $args.Add("Credential", $Credential)
            }

            $result = Get-WmiObject @args

            if ($result -eq $null)
            {
                Write-Error "Unable to retrieve Serial Number from computer '$computername'"
                Exit
            } 
            else 
            {
                $RESTParams.Add("SerialNumber", ($result | Select-Object -ExpandProperty SerialNumber ))

                $args["Class"] = "Win32_ComputerSystem"

                $result = Get-WmiObject @args


                $Manufacturer = $result | Select-Object -ExpandProperty Manufacturer

                if ($Manufacturer -notmatch "Lenovo")
                {
                    Write-Warning "Possibly not a Lenovo device"
                }
                else
                {
                    $RESTParams.Add("Product", ($result | Select-Object -ExpandProperty Model ))
                }
            }
        }
    }

    $webresponse = Invoke-LenovoWarrantyRESTAPI @RESTParams

    if ($null -eq $webresponse) 
    {
        Write-Error "REST API returned NULL"
    }
    else
    {
        #REST API returned data

        $properties = @{}

        if ($webresponse.SelectSingleNode("//serviceInfo")) {

            $properties.Add("ShipDate", ($webresponse.wiOutputForm.warrantyInfo.serviceInfo.shipDate | select -first 1))
            $properties.Add("WarrantyStartDate", ($webresponse.wiOutputForm.warrantyInfo.serviceInfo.warstart | select -first 1))
            $properties.Add("WarrantyEndDate", ($webresponse.wiOutputForm.warrantyInfo.serviceInfo.wed | select -last 1))
        } else {
            $properties.Add("ShipDate", $null)
            $properties.Add("WarrantyStartDate", $null)
            $properties.Add("WarrantyEndDate", $null)
        }


        if ($webresponse.SelectSingleNode("//machineInfo")) {

            $properties.Add("Model", $webresponse.wiOutputForm.warrantyInfo.machineinfo.model)
            $properties.Add("Type", $webresponse.wiOutputForm.warrantyInfo.machineinfo.type)
            $properties.Add("Product", $webresponse.wiOutputForm.warrantyInfo.machineinfo.product)
            $properties.Add("SerialNumber", $webresponse.wiOutputForm.warrantyInfo.machineinfo.serial)
        }
        
        if ($webresponse.SelectSingleNode("//wiInputForm/xmlMessages")) 
        {

            $errorMessage = $webresponse.wiInputForm.xmlMessages.xmlMessage | Where-Object {$_.type -eq "error"}

            if ( $errorMessage -ne $null  ) {
                $properties.Add("ErrorNumber",($errorMessage.num))
                $properties.Add("ErrorText", ($errorMessage.InnerText))

            }
        }
    }

    $WarrantyInfo = New-Object psobject -Property $properties

    $WarrantyInfo    
}

Function Invoke-DynabookWarrantyRESTAPI {
[CmdletBinding()]

    param
    (
        #Specifies the Lenovo serial number
        [Parameter(Mandatory = $true,
        Position = 0 )]
        [Alias('SN')]
        [string]
        $SerialNumber
    )

    $sno=$SerialNumber
    $url = "https://support.dynabook.com/support/warrantyResults?sno="+$sno
    
    $verb = "GET"

    $header = @{ "Content-Type" = "application/application-json" }

    $response = Invoke-RestMethod -Method $verb -Uri $url -Headers $header

    return $response
}

Function Get-DynabookWarrantyInfo {
[CmdletBinding(DefaultParameterSetName="ByComputerName")]

    param (

        #Specifies the Dynabook serial number
        [Parameter(Mandatory = $true,
        ValueFromPipelineByPropertyName = $true,
        ValueFromPipeline = $true,
        Position = 0,
        ParameterSetName="BySerialNumber")]
        [Alias('SN')]
        [string]$SerialNumber
        
    )

    $RESTParams =@{}

    switch($PsCmdlet.ParameterSetName)
    {
        "BySerialNumber"
        {
            $RESTParams.Add("SerialNumber", $SerialNumber)

            
        }
        
    }

    $webresponse = Invoke-DynabookWarrantyRESTAPI @RESTParams

    if ($null -eq $webresponse) 
    {
        Write-Error "REST API returned NULL"
    }
    else
    {
        #REST API returned data

        $properties = @{}
        if ($webresponse.commonBean) {

            $properties.Add("ShipDate", ($webresponse.commonBean.shipDate))
            $properties.Add("WarrantyStartDate", ($Webresponse.commonBean.customerPurchaseDate))
            $properties.Add("WarrantyEndDate", ($Webresponse.commonBean.warrantyExpiryDate))
            $properties.Add("Model", ($Webresponse.commonBean.modelFamily + " " + $Webresponse.commonBean.modelName))
            $properties.Add("Type", ($Webresponse.commonBean.partNumber))
            $properties.Add("Product", ($Webresponse.commonBean.modelName))
            $properties.Add("SerialNumber", ($Webresponse.commonBean.serialNumber))
        } else {
            $properties.Add("ShipDate", $null)
            $properties.Add("WarrantyStartDate", $null)
            $properties.Add("WarrantyEndDate", $null)
        }
    }
    
    $WarrantyInfo = New-Object psobject -Property $properties

    $WarrantyInfo    
}

#Get-MSWarranty is based on https://github.com/KelvinTegelaar/PowerShellWarrantyReports by Kelvin Tegelaar

function Get-MSAuth (){

    [CmdletBinding(DefaultParameterSetName="ByComputerName")]

    param (

        #Specifies the Dynabook serial number
        [Parameter(Mandatory = $true,
        ValueFromPipelineByPropertyName = $true,
        ValueFromPipeline = $true,
        Position = 0,
        ParameterSetName="BySerialNumber")]
        [Alias('SN')]
        [string]$SerialNumber
        
    )

    $RESTParams =@{}

    switch($PsCmdlet.ParameterSetName)
    {
        "BySerialNumber"
        {
            $RESTParams.Add("SerialNumber", $SerialNumber)

            
        }
        
    }

     $body = ConvertTo-Json @{
        sku          = "Surface_"
        SerialNumber = $SerialNumber
        ForceRefresh = $false
    }
    
    $PublicKey = Invoke-RestMethod -Uri 'https://surfacewarrantyservice.azurewebsites.net/api/key' -Method Get
    $AesCSP = New-Object System.Security.Cryptography.AesCryptoServiceProvider 
    $AesCSP.GenerateIV()
    $AesCSP.GenerateKey()
    $AESIVString = [System.Convert]::ToBase64String($AesCSP.IV)
    $AESKeyString = [System.Convert]::ToBase64String($AesCSP.Key)
    $AesKeyPair = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("$AESIVString,$AESKeyString"))
    $bodybytes = [System.Text.Encoding]::UTF8.GetBytes($body)
    $bodyenc = [System.Convert]::ToBase64String($AesCSP.CreateEncryptor().TransformFinalBlock($bodybytes, 0, $bodybytes.Length))
    $RSA = New-Object System.Security.Cryptography.RSACryptoServiceProvider
    $RSA.ImportCspBlob([System.Convert]::FromBase64String($PublicKey))
    $EncKey = [System.Convert]::ToBase64String($rsa.Encrypt([System.Text.Encoding]::UTF8.GetBytes($AesKeyPair), $false))
     
    $FullBody = @{
        Data = $bodyenc
        Key  = $EncKey
    } | ConvertTo-Json
    write-debug $FullBody
    return $FullBody
}


function Get-MSWarrantyinfo{

    [CmdletBinding(DefaultParameterSetName="ByComputerName")]

    param (

        #Specifies the Dynabook serial number
        [Parameter(Mandatory = $true,
        ValueFromPipelineByPropertyName = $true,
        ValueFromPipeline = $true,
        Position = 0,
        ParameterSetName="BySerialNumber")]
        [Alias('SN')]
        [string]$SerialNumber
        
    )

    $RESTParams =@{}

    switch($PsCmdlet.ParameterSetName)
    {
        "BySerialNumber"
        {
            $RESTParams.Add("SerialNumber", $SerialNumber)

            
        }
        
    }

    $today = Get-Date -Format yyyy-MM-dd
    $msAuth = Get-MSAuth $SerialNumber
     
    $warReq = Invoke-RestMethod -uri "https://surfacewarrantyservice.azurewebsites.net/api/v2/warranty" -Method POST -body $msAuth -ContentType "application/json"

    $warranty = $warReq
    $properties = @{}
    if ($WarReq.warranties) {
    $WarrantyState = foreach ($War in ($WarReq.warranties.effectiveenddate -split 'T')[0]) {
        if ($War -le $today) { "Expired" } else { "OK" }
    }
        $properties.Add("ShipDate", ($warranty.warranties.createDateTime))
        $properties.Add("WarrantyStartDate", ($warranty.warranties.effectiveStartDate))
        $properties.Add("WarrantyEndDate", ($warranty.warranties.effectiveEndDate))
        $properties.Add("Model", ($warranty.device.title))
        $properties.Add("Type", ($warranty.device.stockKeepingId))
        $properties.Add("Product", ($warranty.device.deviceId.partId))
        $properties.Add("SerialNumber", ($warranty.device.deviceId.serialNumber))
    } else {
        $properties.Add("ShipDate", $null)
        $properties.Add("WarrantyStartDate", $null)
        $properties.Add("WarrantyEndDate", $null)
    }

    return $properties
}



Function Update-MissingMSWarranties
{
    
    $ComputersMissingWarranty = Get-LabtechData -query "select ComputerID, BiosVer, (case WarrantyEnd when '0000-00-00 00:00:00' then '1979-01-01' else WarrantyEnd end) as 'WarrantyEnd' from computers where (biosmfg like 'Microsoft Corporation') and (biosname not like 'Virtual Machine') and (warrantyend = 0 or assetdate = 0)"
    Write-Host "Submitting $($ComputersMissingWarranty.Count) computers to Microsoft Warranty API: $(($ComputersMissingWarranty.BiosVer) -Join ",")"
    
    $ComputersMissingWarranty | %{
        $WarrantyInfo = Get-MSWarrantyInfo -SerialNumber $_.BiosVer
        $WarrantyInfo | Add-Member -NotePropertyName "ComputerID" -NotePropertyValue $_.ComputerID
        
        $ComputerID = $_.Computerid
        if([String]::IsNullOrEmpty($warrantyinfo.WarrantyEndDate) -eq $false -and [String]::IsNullOrEmpty($WarrantyInfo.ShipDate) -eq $false)
        {
            $EndDate = [DateTime]::Parse($WarrantyInfo.WarrantyEndDate)
            $ShipDate = [DateTime]::Parse($WarrantyInfo.ShipDate)
            Update-WarrantyInLabTech -ComputerID $_.ComputerID -ShipDate $ShipDate -WarrantyEndDate $EndDate
        }
        else
        {
            Write-Host "Microsoft response missing data for Serial Number: $($_.BiosVer) ShipDate: $($WarrantyInfo.ShipDate) EndDate: $($WarrantInfo.WarrantyEndDate)"
        }
    }
}



Function Get-DellWarrantyInfo
{
	Param(
	[Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
    [Array]$ServiceTags,
    [Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
    [Array]$AccessToken
	)
	
    $AuthHeader = @{Authorization="Bearer $AccessToken"}

    $JobResponse = Invoke-RestMethod -Method Get -Uri "https://apigtwb2c.us.dell.com/PROD/sbil/eapi/v5/asset-entitlements?servicetags=$ServiceTags" -headers $AuthHeader -ContentType 'application/json'

    $AllComputerWarranties = $JobResponse | ?{ $_.entitlements } | %{
           $ThisComputerApiResponse = $_
           $ShipDate = $ThisComputerApiResponse.shipDate
           $ThisComputerWarranties = $ThisComputerApiResponse.entitlements | ?{ $_.ServiceLevelCode -notlike "D" }
           $WarrantyStart = $ThisComputerWarranties | sort startDate | Select -First 1 -ExpandProperty startDate
           $WarrantyEnd = $ThisComputerWarranties | sort EndDate | Select -Last 1 -ExpandProperty endDate
           if(-not [String]::IsNullOrEmpty($ShipDate) -and -not [String]::IsNullOrEmpty($WarrantyEnd))
           {
            New-Object psobject -Property @{"WarrantyEndDate"=[DateTime]::Parse($WarrantyEnd.SubString(0,10));"ShipDate"=[DateTime]::Parse($ShipDate.SubString(0,10));"SerialNumber"=$_.ServiceTag}         
           }
           else
           {
            Write-Warning "Invalid Warranty Info received for ServiceTag: $($ThisComputerApiResponse.ServiceTag) ShipDate: $ShipDate WarrantyEnd: $WarrantyEnd `r`n$($ThisComputerWarranties)"
           }
        }

    $AllComputerWarranties
}

Function Update-WarrantyInLabTech
{
Param(
	[Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
	$ComputerID,
    [Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
	[DateTime]$ShipDate,
    [Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
	[DateTime]$WarrantyEndDate
	)

    try
    {
        Write-Output "Updating ComputerID: $ComputerID ShipDate: $ShipDate EndDate: $WarrantyEndDate"
        Assert-LabtechQuery -query "update Computers set WarrantyEnd='$($WarrantyEndDate.ToString("yyyy-MM-dd"))', AssetDate='$($ShipDate.ToString("yyyy-MM-dd"))' where ComputerID=$ComputerID;" | Out-Null
    }
    catch
    {
        $_
    }

}

Function Update-MissingDellWarranties
{
	Param(
	[Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
	[string]$DellClientId,
    [Parameter(
	Mandatory = $true,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
	[string]$DellClientSecret
	)

	$ComputersMissingWarranty = Get-LabtechData -Query "select ComputerID, BiosVer, (case WarrantyEnd when '0000-00-00 00:00:00' then '1979-01-01' else WarrantyEnd end) as 'WarrantyEnd' from computers where BiosMFG = 'Dell' and length(trim(BiosVer)) = 7 and (WarrantyEnd='0000-00-00 00:00:00' or assetdate > WarrantyEnd)"
	
    if($ComputersMissingWarranty.Count -eq 0)
    {
        "No Dell computers missing warranty"
        return
    }

    $uri = "https://apigtwb2c.us.dell.com/auth/oauth/v2/token"

    if(-not $AccessToken)
    { 
        $AuthResponse = Invoke-RestMethod -Method Post -Uri $uri -Body "client_id=$DellClientID&client_secret=$DellClientSecret&grant_type=client_credentials" -ContentType "application/x-www-form-urlencoded"
        if(-not $AuthResponse)
        {
            "Dell API timed out while obtaining access token. Plese try again later"
            return
        }
        $AccessToken = $AuthResponse | select -ExpandProperty access_token
    }

    Write-Host "AccessToken: $AccessToken"

    $Chunks = Split-Array -inArray $ComputersMissingWarranty -size 100

    foreach($Chunk in $Chunks){
        $WarrantyInfoArray = @()
        $WarrantyInfoArray += Get-DellWarrantyInfo -ServiceTags $($Chunk.BiosVer -join ',') -AccessToken $AccessToken
        $WarrantyInfoArray | %{
            $WarrantyInfo = $_
            $ComputerID = $ComputersMissingWarranty | ?{$_.biosver -like $WarrantyInfo.SerialNumber} | select -first 1 -ExpandProperty ComputerID
            Update-WarrantyInLabTech -ComputerID $ComputerID -ShipDate $WarrantyInfo.ShipDate -WarrantyEndDate $WarrantyInfo.WarrantyEndDate
        }
    }
}

Function Update-MissingLenovoWarranties
{
    Param(
	[Parameter(
	Mandatory = $false,
	ParameterSetName = '',
	ValueFromPipeline = $true)]
	[string]$LenovoAPIKey
	)
    $ComputersMissingWarranty = Get-LabtechData -query "select ComputerID, BiosVer, (case WarrantyEnd when '0000-00-00 00:00:00' then '1979-01-01' else WarrantyEnd end) as 'WarrantyEnd' from computers where biosmfg like 'lenovo' and (warrantyend = 0 or assetdate = 0)"
    Write-Host "Submitting $($ComputersMissingWarranty.Count) computers to Lenovo API: $(($ComputersMissingWarranty.BiosVer) -Join ",")"
    
    #$info = Get-LenovoWarrantyInfo -SerialNumber '1045680901618' -Product 20428
    #$LenovoWarrantyInfo = @();
    $ComputersMissingWarranty | %{
        $WarrantyInfo = Get-LenovoWarrantyInfo -SerialNumber $_.BiosVer -Product $_.BiosName
        $WarrantyInfo | Add-Member -NotePropertyName "ComputerID" -NotePropertyValue $_.ComputerID
        
        $ComputerID = $_.Computerid
        if([String]::IsNullOrEmpty($warrantyinfo.WarrantyEndDate) -eq $false -and [String]::IsNullOrEmpty($WarrantyInfo.ShipDate) -eq $false)
        {
            $EndDate = [DateTime]::Parse($WarrantyInfo.WarrantyEndDate)
            $ShipDate = [DateTime]::Parse($WarrantyInfo.ShipDate)
            Update-WarrantyInLabTech -ComputerID $_.ComputerID -ShipDate $ShipDate -WarrantyEndDate $EndDate
        }
        else
        {
            Write-Host "Lenovo response missing data for Serial Number: $($_.BiosVer) ShipDate: $($WarrantyInfo.ShipDate) EndDate: $($WarrantInfo.WarrantyEndDate)"
        }
    }
}

Function Update-MissingHPWarranties
{   

    $HPComputers = Get-LabtechData -query "select ComputerID, BiosVer sn, (case WarrantyEnd when '0000-00-00 00:00:00' then '1979-01-01' else WarrantyEnd end) as 'WarrantyEnd', inv_chassis.SKUNumber pn from computers join inv_chassis using(computerid) where BiosMFG like 'h%p%' and (WarrantyEnd='0000-00-00 00:00:00' or assetdate > WarrantyEnd)"
    "$($HPComputers.Count) HP computers found in need of warranty information"  
    
    
    for($i=0;$i -lt $HPComputers.Count;$i++)
        {
            $WarrantyInfo = Get-HPIncWarrantyEntitlement -SerialNumber $HPComputers[$i].sn -ProductNumber $HPComputers[$i].pn
                        
            if($WarrantyInfo.OverallEntitlementStartDate -ne $null)
                {
                    try
                    {
                        if(($WarrantyInfo.OverallEntitlementEndDate | Measure-Object).Count -gt 1)
                            {
                                $end = $([DateTime]::Parse($WarrantyInfo.OverallEntitlementEndDate[0]))
                            }else{
                                $end = $([DateTime]::Parse($WarrantyInfo.OverallEntitlementEndDate))
                            }

                        if(($WarrantyInfo.OverallEntitlementStartDate | Measure-Object).Count -gt 1)
                            {
                                $start = $([DateTime]::Parse($WarrantyInfo.OverallEntitlementStartDate[0]))
                            }else{
                                $start = $([DateTime]::Parse($WarrantyInfo.OverallEntitlementStartDate))
                            }


                        Update-WarrantyInLabTech -ComputerID $HPComputers[$i].ComputerID -ShipDate $start -WarrantyEndDate $end -ErrorAction Stop
                    }
                    catch
                    {
                        Write-Output "Error updating $($HPComputers[$i].ComputerID): End date: $end"
                    }
                }
                else
                {
                    Write-Output "No Warranty Info returned for $($HPComputers[$i].ComputerID)"
                }
        }
        
        
     
}


Function Update-MissingDynabookWarranties
{
    
    $ComputersMissingWarranty = Get-LabtechData -query "select ComputerID, BiosVer, (case WarrantyEnd when '0000-00-00 00:00:00' then '1979-01-01' else WarrantyEnd end) as 'WarrantyEnd' from computers where (biosmfg like 'toshiba' or biosmfg like 'Dynabook Inc.') and (warrantyend = 0 or assetdate = 0)"
    Write-Host "Submitting $($ComputersMissingWarranty.Count) computers to Dynabook API: $(($ComputersMissingWarranty.BiosVer) -Join ",")"
    
    $ComputersMissingWarranty | %{
        $WarrantyInfo = Get-DynabookWarrantyInfo -SerialNumber $_.BiosVer
        $WarrantyInfo | Add-Member -NotePropertyName "ComputerID" -NotePropertyValue $_.ComputerID
        
        $ComputerID = $_.Computerid
        if([String]::IsNullOrEmpty($warrantyinfo.WarrantyEndDate) -eq $false -and [String]::IsNullOrEmpty($WarrantyInfo.ShipDate) -eq $false)
        {
            $EndDate = [DateTime]::Parse($WarrantyInfo.WarrantyEndDate)
            $ShipDate = [DateTime]::Parse($WarrantyInfo.ShipDate)
            Update-WarrantyInLabTech -ComputerID $_.ComputerID -ShipDate $ShipDate -WarrantyEndDate $EndDate
        }
        else
        {
            Write-Host "Dynabook response missing data for Serial Number: $($_.BiosVer) ShipDate: $($WarrantyInfo.ShipDate) EndDate: $($WarrantInfo.WarrantyEndDate)"
        }
    }
}

    
$DellClientId = 'DellClientID'
$DellClientSecret = 'DellClientSecret'

Write-Host "Trimming SerialNumbers"
Assert-LabtechQuery "update computers set BiosVer=trim(BiosVer) where BiosVer like ' %' or BiosVer like '% '" | out-null
Write-Host "Updating Dell Warranties"
Update-MissingDellWarranties -DellClientId $DellClientId -DellClientSecret $DellClientSecret
Write-Host "Updating Lenovo Warranties"
Update-MissingLenovoWarranties
Write-Host "Updating HP Warranties"
Update-MissingHPWarranties
Write-Host "Updating Dynabook/Toshiba Warranties"
Update-MissingDynabookWarranties
Write-Host "Updating Microsoft Corporation Warranties"
Update-MissingMSWarranties

 

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...