Printer purge filters PCs before reporting how many are affected

This commit is contained in:
Zachary Gorman 2025-03-03 09:26:13 -08:00
parent 3551de4ac0
commit feec780f84
2 changed files with 2 additions and 3 deletions

View file

@ -1,7 +1,7 @@
# Removes printer from all online computers. Useful when printer drivers # Removes printer from all online computers. Useful when printer drivers
# change to force online users to install new drivers # change to force online users to install new drivers
function Invoke-PrinterPurge ($printer) { function Invoke-PrinterPurge ($printer) {
$comps = HostnamesByPrinter($printer) $comps = HostnamesByPrinter $printer | Where-Object { $_ -notmatch "EPIC"}
if (-not ($comps -is [array])) { if (-not ($comps -is [array])) {
$comps = @($comps) $comps = @($comps)
} }
@ -14,8 +14,6 @@ function Invoke-PrinterPurge ($printer) {
$comp = $comps[$i] $comp = $comps[$i]
Write-Progress -Activity "Dispatching Remove-Printer Jobs for $printer" -PercentComplete (100*$i / $comps.Length) -CurrentOperation "$comp $i/$($comps.Length)" -ParentId 1 Write-Progress -Activity "Dispatching Remove-Printer Jobs for $printer" -PercentComplete (100*$i / $comps.Length) -CurrentOperation "$comp $i/$($comps.Length)" -ParentId 1
if ($comp -like "*EPIC*") { continue }
if (-not (Test-Connection $comp -Count 1)) { if (-not (Test-Connection $comp -Count 1)) {
Write-Output "$printer | $comp Offline" Write-Output "$printer | $comp Offline"
continue continue

View file

@ -1,6 +1,7 @@
Patch Patch
-Fix Queries Spark! by asset tag rather than hostname to also hit in stock workstations -Fix Queries Spark! by asset tag rather than hostname to also hit in stock workstations
-Add Elo monitor ports to -devices -Add Elo monitor ports to -devices
-Fix PrinterPurge more accurately reflects how many computers are affected
Patch 2025-2-24 Patch 2025-2-24
-Fix Devices and DevicesUnplugged 1.4x speedup -Fix Devices and DevicesUnplugged 1.4x speedup