From 15e351004bdd9a00511efa50c0a19e838e103b46 Mon Sep 17 00:00:00 2001 From: nichols-eric <168233629+nichols-eric@users.noreply.github.com> Date: Thu, 28 May 2026 23:03:05 -0700 Subject: [PATCH 1/2] Create README.md --- .../Get-Dell-Warranty-CMD/README.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 PowerShell Scanners/Get-Dell-Warranty-CMD/README.md diff --git a/PowerShell Scanners/Get-Dell-Warranty-CMD/README.md b/PowerShell Scanners/Get-Dell-Warranty-CMD/README.md new file mode 100644 index 0000000..2dc66e7 --- /dev/null +++ b/PowerShell Scanners/Get-Dell-Warranty-CMD/README.md @@ -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 From 1c903f1c46b2cf3d5faef55362d4fcfc89510523 Mon Sep 17 00:00:00 2001 From: nichols-eric <168233629+nichols-eric@users.noreply.github.com> Date: Thu, 28 May 2026 23:03:45 -0700 Subject: [PATCH 2/2] Add files via upload --- .../Get-Dell-Warranty-CMD.ps1 | 61 +++++++++++++++++++ .../Get-Dell-Warranty-CMD/Scan Profile.xml | 29 +++++++++ 2 files changed, 90 insertions(+) create mode 100644 PowerShell Scanners/Get-Dell-Warranty-CMD/Get-Dell-Warranty-CMD.ps1 create mode 100644 PowerShell Scanners/Get-Dell-Warranty-CMD/Scan Profile.xml diff --git a/PowerShell Scanners/Get-Dell-Warranty-CMD/Get-Dell-Warranty-CMD.ps1 b/PowerShell Scanners/Get-Dell-Warranty-CMD/Get-Dell-Warranty-CMD.ps1 new file mode 100644 index 0000000..7bc3e4d --- /dev/null +++ b/PowerShell Scanners/Get-Dell-Warranty-CMD/Get-Dell-Warranty-CMD.ps1 @@ -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 \ No newline at end of file diff --git a/PowerShell Scanners/Get-Dell-Warranty-CMD/Scan Profile.xml b/PowerShell Scanners/Get-Dell-Warranty-CMD/Scan Profile.xml new file mode 100644 index 0000000..8c035d0 --- /dev/null +++ b/PowerShell Scanners/Get-Dell-Warranty-CMD/Scan Profile.xml @@ -0,0 +1,29 @@ + + + + + + + 2026-05-28T22:49:37.8428150-07:00 + Get-Dell-Warranty-CMD + 20ff84d0445c46b2960380a273afe89b + + C:\PowerShell-Scanners\PowerShell Scanners\Get-Dell-Warranty-CMD\Get-Dell-Warranty-CMD.ps1 + + + + + + PowerShell + + + + Get Dell warranty start and end date using Dell command line tool hence "CMD" versus "API" + + PS - Get-Dell-Warranty-CMD + + + + + \ No newline at end of file