Created
March 13, 2013 23:22
-
-
Save mortenson/9aa0b4f1228f4c3a8e66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$service = New-WebServiceProxy -Uri http://143.166.84.118/services/assetservice.asmx?WSDL | |
if($args.count -ne 0){ | |
$serial = $args[0] | |
} | |
else{ | |
$system = Get-WmiObject win32_SystemEnclosure | |
$serial = $system.serialnumber | |
} | |
$guid = [guid]::NewGuid() | |
$info = $service.GetAssetInformation($guid,'check_warranty.ps1',$serial) | |
if($info.count -eq 0) | |
{ | |
Write-Host "Machine is not a Dell" | |
} | |
else | |
{ | |
$warranty = $info[0].Entitlements[0] | |
$expires = $warranty.EndDate | |
$days_left = $warranty.DaysLeft | |
if($days_left -eq 0) | |
{ | |
Write-Host "Warranty has expired" | |
} | |
else{ | |
Write-Host "Warranty expires $expires." | |
Write-Host "Warranty is valid for $days_left days." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment