Zebra printer statuses fix and ZD421 serial number fix

This commit is contained in:
Zachary Gorman 2025-06-10 10:11:03 -07:00
parent 920949721f
commit 9649f47b8a
2 changed files with 19 additions and 17 deletions

View file

@ -196,14 +196,10 @@ $Headers = @{
Write-Progress -Activity "Getting zebra features from $name" -Status 'Querying for MAC address' -PercentComplete 50 -ParentId 2
try { $MAC = $snmp.Get('.1.3.6.1.4.1.10642.20.10.20.10.2.1.5.2').toupper() } catch { $MAC = $null }
Write-Progress -Activity "Getting zebra features from $name" -Status 'Querying for serial number' -PercentComplete 70 -ParentId 2
try { $serial = $snmp.Get('.1.3.6.1.4.1.10642.200.19.5.0') } catch { $serial = $null }
try { $serial = $snmp.Get('.1.3.6.1.4.1.10642.1.9.0') } catch { $serial = $null }
if (!$serial) { try { $serial = $snmp.Get('.1.3.6.1.4.1.10642.200.19.5.0') } catch { $serial = $null } }
# try { $status = $snmp.Get('.1.3.6.1.4.1.10642.200.4.1.0') } catch { $status = $null }
# Zebra GK420
Write-Progress -Activity "Getting zebra features from $name" -Status 'Querying for IP assignment mode' -PercentComplete 80 -ParentId 2
try { $ipconfig = "($($snmp.Get('.1.3.6.1.4.1.10642.200.50.1.1.5.0')))" } catch { $ipconfig = $null }
# Zebra ZD421
if (!$ipconfig) {
Write-Progress -Activity "Getting zebra features from $name" -Status 'Querying for IP assignment mode (2nd attempt)' -PercentComplete 85 -ParentId 2
try { $ipconfig = $snmp.Get('.1.3.6.1.4.1.10642.20.10.20.15.2.1.5.2') } catch { $ipconfig = $null }
$ipconfig = switch ($ipconfig) {
1 {'(All)'}
@ -213,15 +209,17 @@ $Headers = @{
5 {'(DHCP)'}
6 {'(DHCP AND BOOTP)'}
7 {'(PERMANENT)'}
}
default {'(UNKNOWN)'}
}
$model = "Zebra $model"
Write-Progress -Activity "Getting zebra features from $name" -Status 'Querying for status' -PercentComplete 90 -ParentId 2
#STATUS
$uri = $domainName
$uri = "http://$printerip"
$html = Invoke-WebRequest -uri $uri
$raw = $html.rawcontent
$raw -match '([A-Z])\w+<.F' | Out-Null
# Captures the first text between a > and < after "Status:"
#$raw -match 'Status:.*>(\w+)<.*>(\w+)<' | Out-Null
$status = ($Matches[0] -split '<')[0]
#split off error condition
$raw -match 'RED>.+' | Out-Null

View file

@ -1,3 +1,7 @@
Patch
-Fix Zebra printer statuses report correctly now
-Fix ZD421 printers report Serial numbers correctly
Patch 2025-5-28
-Update SCCMQueryBlock uses asset tag to query Spark!
-Fix SCCM apps report version correctly