Printer Purge almost ready to be tested
This commit is contained in:
parent
dbc803b1cc
commit
433d89c8b9
18
Private/PrinterPurge.ps1
Normal file
18
Private/PrinterPurge.ps1
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Removes printer from all online computers. Useful when printer drivers
|
||||||
|
# change to force users to install new drivers
|
||||||
|
function Invoke-PrinterPurge ($printer) {
|
||||||
|
$comps = HostnamesByPrinter($printer)
|
||||||
|
# confirm step?
|
||||||
|
for ($i = 0; $i -lt $comps.Length; $i += 1) {
|
||||||
|
$comp = $comps[$i]
|
||||||
|
Write-Progress -Activity "Dispatching Remove-Printer Jobs for $printer" -PercentComplete (100*$i / $comps.Length) -CurrentOperation $comp
|
||||||
|
if ($comp -like "*EPIC*") { continue }
|
||||||
|
if (-not (Test-Connection $comp -Count 1)) {
|
||||||
|
Write-Output "$printer | $comp Offline"
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
# Remove-Printer $printer -ComputerName $comp -AsJob
|
||||||
|
Write-Output "$printer | $comp Job Sent"
|
||||||
|
}
|
||||||
|
Write-Progress -Activity "Dispatching Remove-Printer Jobs for $printer" -Completed
|
||||||
|
}
|
||||||
|
|
@ -56,6 +56,7 @@ Function Get-PC {
|
||||||
-RequestLauncher | starts request launcher
|
-RequestLauncher | starts request launcher
|
||||||
-ResetRepository | remotely resets repository
|
-ResetRepository | remotely resets repository
|
||||||
-Resources | more details about system resources
|
-Resources | more details about system resources
|
||||||
|
-PrinterPurge | removes printer from all online computers
|
||||||
-SCCM | queries sccm for the computer information
|
-SCCM | queries sccm for the computer information
|
||||||
-SHSPrinter | pulls data about a printer using snmp
|
-SHSPrinter | pulls data about a printer using snmp
|
||||||
-SHSPrinterweb | pulls data about a printer and opens web interface and orion
|
-SHSPrinterweb | pulls data about a printer and opens web interface and orion
|
||||||
|
|
@ -105,6 +106,7 @@ Function Get-PC {
|
||||||
[Switch]$RequestLauncher,
|
[Switch]$RequestLauncher,
|
||||||
[Switch]$Resources,
|
[Switch]$Resources,
|
||||||
[Switch]$ResetRepository,
|
[Switch]$ResetRepository,
|
||||||
|
[Switch]$PrinterPurge,
|
||||||
[Switch]$SCCM,
|
[Switch]$SCCM,
|
||||||
[Switch]$SHSPrinter,
|
[Switch]$SHSPrinter,
|
||||||
[switch]$SHSPrinterWeb,
|
[switch]$SHSPrinterWeb,
|
||||||
|
|
@ -293,6 +295,11 @@ Function Get-PC {
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($PrinterPurge) {
|
||||||
|
Invoke-PrinterPurge $comp
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
#Launches the request launcher script which containts landesk request template scripts
|
#Launches the request launcher script which containts landesk request template scripts
|
||||||
if ($RequestLauncher) {
|
if ($RequestLauncher) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue