Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
$tempPath = $env:TEMP
$TagFile = Join-Path -Path $tempPath -ChildPath "servicetag.csv"
$WarrantyFile = Join-Path -Path $tempPath -ChildPath "warranty.csv"
$cliPath = "C:\Program Files (x86)\Dell\CommandIntegrationSuite\DellWarranty-CLI.exe" #https://www.dell.com/support/kbdoc/en-us/000146749/dell-command-warranty
#to install silent the exe switch is /Q /v/qn

$CacheDays = 30

# 1. Get Service Tag
$ServiceTag = (Get-CimInstance Win32_BIOS).SerialNumber

# 2. Determine if we need to run a fresh scan
$NeedsUpdate = $true
if (Test-Path $WarrantyFile) {
$FileAge = (Get-Date) - (Get-Item $WarrantyFile).LastWriteTime
if ($FileAge.Days -lt $CacheDays) {
$NeedsUpdate = $false
}
}

# 3. Run the EXE only if needed
if ($NeedsUpdate) {
if (Test-Path $cliPath) {
$ServiceTag | Out-File -FilePath $TagFile -Encoding ascii
& $cliPath /I="$TagFile" /E="$WarrantyFile" *> $null
if (Test-Path $TagFile) { Remove-Item $TagFile -Force }
}
else {
return [PSCustomObject]@{
"Service Tag" = $ServiceTag
"Warranty Start Date" = $null
"Warranty End Date" = $null
"Status" = "CLI Tool Not Installed"
}
}
}

# 4. Import and Parse the (New or Cached) file
if ((Test-Path $WarrantyFile) -and (Get-Item $WarrantyFile).Length -gt 0) {
$rawCSV = Import-Csv -Path $WarrantyFile

$latestStart = ($rawCSV | ForEach-Object { [datetime]$_."Start Date" } | Sort-Object -Descending | Select-Object -First 1)
$latestEnd = ($rawCSV | ForEach-Object { [datetime]$_."End Date" } | Sort-Object -Descending | Select-Object -First 1)

$Result = [PSCustomObject]@{
"Service Tag" = $ServiceTag
"Warranty Start Date" = $latestStart.ToString("yyyy-MM-dd")
"Warranty End Date" = $latestEnd.ToString("yyyy-MM-dd")
"Status" = if ($NeedsUpdate) { "Fresh Scan" } else { "Cached (Age: $($FileAge.Days) days)" }
}
}
else {
$Result = [PSCustomObject]@{
"Service Tag" = $ServiceTag
"Warranty Start Date" = $null
"Warranty End Date" = $null
"Status" = "No Warranty Data Found"
}
}

return $Result
22 changes: 22 additions & 0 deletions PowerShell Scanners/Get-Dell-Warranty-CMD/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Get-Dell-Warranty-CMD

## Instructions

Install Dell Command | Integration Suite for System Center, dont worry its not just for system center, it installs as a normal Dell command line tool like all the others.

At time of writing:
https://www.dell.com/support/kbdoc/en-us/000146749/dell-command-warranty

## Description

Get Dell warranty start and end date using Dell command line tool hence "CMD" versus "API"
There is an API based tool available for PDQ Inventory on GitHub https://github.com/nichols-eric/KUDellWarrantyChecker

## Compatibility

* **PDQ Inventory**: No
* **PDQ Connect**: Yes

## Author

Eric Nichols
29 changes: 29 additions & 0 deletions PowerShell Scanners/Get-Dell-Warranty-CMD/Scan Profile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<AdminArsenal.Export Code="PDQInventory" Name="PDQ Inventory" Version="19.3.30.0" MinimumVersion="19.0">
<ScanProfile>
<Collections type="list" />
<Scanners type="list">
<Scanner>
<ModifiedDate>2026-05-28T22:49:37.8428150-07:00</ModifiedDate>
<Name>Get-Dell-Warranty-CMD</Name>
<UID>20ff84d0445c46b2960380a273afe89b</UID>
<Script>
</Script>
<FileName>C:\PowerShell-Scanners\PowerShell Scanners\Get-Dell-Warranty-CMD\Get-Dell-Warranty-CMD.ps1</FileName>
<Parameters>
</Parameters>
<AdditionalFiles>
</AdditionalFiles>
<RowLimit value="100" />
<TypeName>PowerShell</TypeName>
<SourceScannerId value="90" />
</Scanner>
</Scanners>
<Description>Get Dell warranty start and end date using Dell command line tool hence "CMD" versus "API"</Description>
<ScanProfileId value="33" />
<Name>PS - Get-Dell-Warranty-CMD</Name>
<ScheduleTriggerSet name="ScheduleTriggers">
<Triggers type="list" />
</ScheduleTriggerSet>
</ScanProfile>
</AdminArsenal.Export>