2 0

Delete Printers

Detection:

# Check if Fax printer is installed
$FaxPrinter = Get-Printer -Name "Fax" -ErrorAction SilentlyContinue

if ($FaxPrinter -ne $null) {
    Write-Output "Fax printer is installed"
    exit 1
} else {
    Write-Output "Fax printer is not installed"
    exit 0
}

Remediation:

Remove-Printer -Name "OneNote (Desktop)" -ErrorAction SilentlyContinue
Remove-Printer -Name "Microsoft XPS Document Writer" -ErrorAction SilentlyContinue
Remove-Printer -Name "OneNote for Windows 10" -ErrorAction SilentlyContinue
Remove-Printer -Name "Fax" -ErrorAction SilentlyContinue