Zebra printer statuses fix and ZD421 serial number fix
This commit is contained in:
parent
920949721f
commit
9649f47b8a
|
|
@ -196,14 +196,10 @@ $Headers = @{
|
||||||
Write-Progress -Activity "Getting zebra features from $name" -Status 'Querying for MAC address' -PercentComplete 50 -ParentId 2
|
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 }
|
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
|
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 }
|
# 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
|
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 }
|
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) {
|
$ipconfig = switch ($ipconfig) {
|
||||||
1 {'(All)'}
|
1 {'(All)'}
|
||||||
|
|
@ -213,15 +209,17 @@ $Headers = @{
|
||||||
5 {'(DHCP)'}
|
5 {'(DHCP)'}
|
||||||
6 {'(DHCP AND BOOTP)'}
|
6 {'(DHCP AND BOOTP)'}
|
||||||
7 {'(PERMANENT)'}
|
7 {'(PERMANENT)'}
|
||||||
}
|
default {'(UNKNOWN)'}
|
||||||
}
|
}
|
||||||
$model = "Zebra $model"
|
$model = "Zebra $model"
|
||||||
Write-Progress -Activity "Getting zebra features from $name" -Status 'Querying for status' -PercentComplete 90 -ParentId 2
|
Write-Progress -Activity "Getting zebra features from $name" -Status 'Querying for status' -PercentComplete 90 -ParentId 2
|
||||||
#STATUS
|
#STATUS
|
||||||
$uri = $domainName
|
$uri = "http://$printerip"
|
||||||
$html = Invoke-WebRequest -uri $uri
|
$html = Invoke-WebRequest -uri $uri
|
||||||
$raw = $html.rawcontent
|
$raw = $html.rawcontent
|
||||||
$raw -match '([A-Z])\w+<.F' | Out-Null
|
$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]
|
$status = ($Matches[0] -split '<')[0]
|
||||||
#split off error condition
|
#split off error condition
|
||||||
$raw -match 'RED>.+' | Out-Null
|
$raw -match 'RED>.+' | Out-Null
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
Patch
|
||||||
|
-Fix Zebra printer statuses report correctly now
|
||||||
|
-Fix ZD421 printers report Serial numbers correctly
|
||||||
|
|
||||||
Patch 2025-5-28
|
Patch 2025-5-28
|
||||||
-Update SCCMQueryBlock uses asset tag to query Spark!
|
-Update SCCMQueryBlock uses asset tag to query Spark!
|
||||||
-Fix SCCM apps report version correctly
|
-Fix SCCM apps report version correctly
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue