Printers
12 TopicsGroup Policy object did not apply because failed error code:0x80070709 The printer name is invalid
Hi Everyone, I have a few AVD pools where we publish an app for users to access. Users report that printers are not being mapped after login. We use GPP user side to map printers and set as default. Many a times we see these events logged: VALUE>The printer name is invalid.</VALUE></PROPERTY>-</INSTANCE> Event ID 4098 is logged in the Application Log: Log Name: Application Source: Group Policy Printers Date: <DateTime> Event ID: 4098 Task Category: (2) Level: Warning Keywords: Classic User: SYSTEM Computer: server.fabrikam.com Description: The user 'HP Printer' preference item in the 'Define Printers {XXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}' Group Policy object did not apply because it failed with error code '0x80070709 The printer name is invalid.' This error was suppressed. For this one I found this https://learn.microsoft.com/en-us/troubleshoot/windows-server/group-policy/group-policy-printer-preferences-not-set-default-printer#resolution which is really not helpful since there is no possible solution as the client is a AVD VM and used by many users at the same time. VALUE> No printers were found.' VALUE></PROPERTY>-</INSTANCE> Event ID 4098 is logged in the Application Log: Log Name: Application Source: Group Policy Printers Date: <DateTime> Event ID: 4098 Task Category: (2) Level: Warning Keywords: Classic User: SYSTEM Computer: server.fabrikam.com Description: The user 'Accounts - Main Printer' preference item in the 'Printers - Global {zzzzzzzzzzzzzzzzzzzzz}' Group Policy Object did not apply because it failed with error code '0x80070bc4 No printers were found.' This error was suppressed. VALUE>The specified printer has been deleted.</VALUE></PROPERTY>-</INSTANCE> Event ID 4098 is logged in the Application Log: Log Name: Application Source: Group Policy Printers Date: <DateTime> Event ID: 4098 Task Category: (2) Level: Warning Keywords: Classic User: SYSTEM Computer: server.fabrikam.com Description: The user 'Sales-Printer' preference item in the 'Printers - Global {zzzzzzzzzzzzzzzzzzzzz}' Group Policy Object did not apply because it failed with error code '0x80070771 The specified printer has been deleted.' This error was suppressed. No KB's or posts out there to help with these 2 errors. Really need assistance and printers are not being mapped on first logon, users need to come out of AVD and go back and relaunch the app to see the printers mapped. This is the same case with our internal app or Notepad. Thanks, M2.2KViews0likes2CommentsHelp with Powershell scripts to backup and restore printers
Hello all. I'm rather new to PowerShell. I hope I'm not causing any grief here. I whipped together a proof of concept because I need to protect certain computers' printing abilities as they are crucial to our business. I know I can use Print Migration to export and import the set of printers. I don't know how to start Printer Migration giving it a destination of the UNC to the server, the current computer's name. It does not seem to restore all the printers either. I really would appreciate the ability to clone an existing printer to a new name and new IP address. I wanted to see how far Perplexity.AI could take this. It made a start but then started forgetting requirements, re-writing whole scripts, and losing functionality already obtained. My premise is that copying is backup, change, and restore. So I made Backup-SinglePrinter, Restore-SinglePrinter, and Copy-ExistingPrinter. A settings file is included. I expect that once backup-singleprinter and restore-singleprinter work, I could make a BackupPrinters and RestorePrinters to handle all existing printers. One final thing is I would like to have the scripts locate each other by using the single settings file or by knowing the starting location of the first script. Mike Copy-ExistingPrinter.ps1 <# .SYNOPSIS Copies an existing printer to a new printer with a different name and a new IP address. .DESCRIPTION This script copies an existing printer by backing it up, modifying the backup, and then restoring it with a new name and a new IP address. .PARAMETER ExistingPrinterName The name of the existing printer to copy from. .PARAMETER NewPrinterName The name of the new printer to create. .EXAMPLE .\Copy-ExistingPrinter.ps1 -ExistingPrinterName "Printer1" -NewPrinterName "Printer2" #> param ( [Parameter(Mandatory=$true)] [string]$ExistingPrinterName, [Parameter(Mandatory=$true)] [string]$NewPrinterName ) # Import settings $settingsPath = Join-Path $PSScriptRoot "settings.ps1" if (Test-Path $settingsPath) { . $settingsPath } else { Write-Error "Settings file not found at $settingsPath" exit 1 } # Verify that $BaseFolder is set in settings.ps1 if (-not $BaseFolder) { Write-Error "BaseFolder is not set in settings.ps1" exit 1 } # Manually import required modules $modulesToImport = @( "Backup-SinglePrinter.psm1", "Restore-SinglePrinter.psm1", "Find-AvailableIPPort.psm1", "Get-PrinterExtendedConfig.psm1" ) foreach ($module in $modulesToImport) { $modulePath = Join-Path $BaseFolder $module if (Test-Path $modulePath) { Import-Module $modulePath -Force Write-Host "Imported module: $module" -ForegroundColor Green } else { Write-Error "Module $module not found at $modulePath" exit 1 } } # Verify that the functions are available $requiredFunctions = @("Backup-SinglePrinter", "Restore-SinglePrinter", "Find-AvailableIPPort", "Get-PrinterExtendedConfig") foreach ($func in $requiredFunctions) { if (-not (Get-Command -Name $func -ErrorAction SilentlyContinue)) { Write-Error "Required function $func is not available." exit 1 } else { Write-Host "Function $func is available." -ForegroundColor Green } } try { # Create backup folder structure $backupsFolder = Join-Path $BaseFolder "Backups" $computerName = $env:COMPUTERNAME $computerBackupFolder = Join-Path $backupsFolder $computerName $driversFolder = Join-Path $computerBackupFolder "Drivers" if (-not (Test-Path $computerBackupFolder)) { New-Item -ItemType Directory -Path $computerBackupFolder -Force | Out-Null } if (-not (Test-Path $driversFolder)) { New-Item -ItemType Directory -Path $driversFolder -Force | Out-Null } # Backup the existing printer Write-Host "Backing up existing printer: $ExistingPrinterName" -ForegroundColor Cyan $backupFileName = "$ExistingPrinterName.xml" $backupFile = Join-Path $computerBackupFolder $backupFileName $backupResult = Backup-SinglePrinter -PrinterName $ExistingPrinterName -BackupFile $backupFile if (-not $backupResult) { throw "Failed to backup the existing printer." } # Get the IP address of the existing printer $existingPrinter = Get-Printer -Name $ExistingPrinterName $existingPort = Get-PrinterPort -Name $existingPrinter.PortName $BaseIP = $existingPort.PrinterHostAddress if ([string]::IsNullOrEmpty($BaseIP)) { Write-Error "Unable to retrieve IP address for existing printer $ExistingPrinterName" exit 1 } Write-Host "Existing printer IP address: $BaseIP" -ForegroundColor Cyan # Find an available IP port for the new printer Write-Host "Finding an available IP port for the new printer" -ForegroundColor Cyan $NewIPAddress = Find-AvailableIPPort -BaseIP $BaseIP if ($NewIPAddress) { Write-Host "Available IP port found: $NewIPAddress" -ForegroundColor Green } else { throw "No available IP address found." } # Create a new port with the new IP address $NewPortName = $NewIPAddress Add-PrinterPort -Name $NewPortName -PrinterHostAddress $NewIPAddress # Restore the modified backup as a new printer Write-Host "Restoring modified backup as new printer: $NewPrinterName" -ForegroundColor Cyan $restoreResult = Restore-SinglePrinter -BackupFile $backupFile -NewPrinterName $NewPrinterName -NewPortName $NewPortName if ($restoreResult) { Write-Host "Printer '$ExistingPrinterName' successfully copied to '$NewPrinterName' with IP $NewIPAddress." -ForegroundColor Green # Create a backup summary $summaryFile = Join-Path $computerBackupFolder "BackupSummary.txt" $summaryContent = @" Backup performed on: $(Get-Date) Original Printer: $ExistingPrinterName New Printer: $NewPrinterName New IP Address: $NewIPAddress "@ Add-Content -Path $summaryFile -Value $summaryContent } else { throw "Failed to restore the new printer." } } catch { Write-Error "An error occurred during the printer copying process: $_" # Clean up the new printer if it was created if (Get-Printer -Name $NewPrinterName -ErrorAction SilentlyContinue) { Remove-Printer -Name $NewPrinterName -ErrorAction SilentlyContinue } # Clean up the new port if it was created if ($NewPortName -and (Get-PrinterPort -Name $NewPortName -ErrorAction SilentlyContinue)) { Remove-PrinterPort -Name $NewPortName -ErrorAction SilentlyContinue } } # Script Version: 3.9 Backup-SinglePrinter.psm1 function Backup-SinglePrinter { param ( [Parameter(Mandatory=$true)] [string]$PrinterName, [Parameter(Mandatory=$true)] [string]$BackupFile ) # Import settings $settingsPath = Join-Path $PSScriptRoot "settings.ps1" if (Test-Path $settingsPath) { . $settingsPath } else { Write-Error "Settings file not found at $settingsPath" return $false } # Import printer properties $propertiesModulePath = Join-Path $BaseFolder "Get-PrinterExtendedConfig.psm1" if (Test-Path $propertiesModulePath) { Import-Module $propertiesModulePath -Force } else { Write-Error "Get-PrinterExtendedConfig module not found at $propertiesModulePath" return $false } $computerName = $env:COMPUTERNAME $computerBackupFolder = Join-Path $BackupsFolder $computerName $driversFolder = Join-Path $computerBackupFolder "Drivers" if (-not (Test-Path $computerBackupFolder)) { New-Item -ItemType Directory -Path $computerBackupFolder -Force | Out-Null } if (-not (Test-Path $driversFolder)) { New-Item -ItemType Directory -Path $driversFolder -Force | Out-Null } try { $printer = Get-Printer -Name $PrinterName -Full $printerConfig = Get-PrintConfiguration -PrinterName $PrinterName $printerProperties = Get-PrinterProperty -PrinterName $PrinterName $backupObject = @{ Printer = $printer Configuration = $printerConfig Properties = $printerProperties IsShared = $printer.Shared ShareName = $printer.ShareName } $backupObject | Export-Clixml -Path $BackupFile -Depth 10 # Backup driver files $driverName = $printer.DriverName $driverInfo = Get-PrinterDriver -Name $driverName $driverPath = $driverInfo.InfPath if ($driverPath) { Copy-Item -Path $driverPath -Destination $driversFolder -Force } Write-Host "Printer '$PrinterName' backed up successfully to $BackupFile" return $true } catch { Write-Error "Printer backup process failed: $_" return $false } } Export-ModuleMember -Function Backup-SinglePrinter Restore-SinglePrinter.psm1 function Restore-SinglePrinter { param ( [Parameter(Mandatory=$true)] [string]$BackupFile, [Parameter(Mandatory=$true)] [string]$NewPrinterName, [Parameter(Mandatory=$false)] [string]$NewPortName ) try { $backupObject = Import-Clixml -Path $BackupFile $printer = $backupObject.Printer $printerConfig = $backupObject.Configuration $printerProperties = $backupObject.Properties # Import printer properties module $propertiesModulePath = Join-Path $PSScriptRoot "Get-PrinterExtendedConfig.psm1" if (Test-Path $propertiesModulePath) { Import-Module $propertiesModulePath -Force } else { Write-Error "Get-PrinterExtendedConfig module not found at $propertiesModulePath" return $false } $printerExtendedConfig = Get-PrinterExtendedConfig # If NewPortName is not provided, use the original port if (-not $NewPortName) { $NewPortName = $printer.PortName } # Create or update the printer if (Get-Printer -Name $NewPrinterName -ErrorAction SilentlyContinue) { Set-Printer -Name $NewPrinterName -DriverName $printer.DriverName -PortName $NewPortName } else { Add-Printer -Name $NewPrinterName -DriverName $printer.DriverName -PortName $NewPortName } # Restore printer settings $validPrinterParams = $printerExtendedConfig.PrinterProperties $printerParams = @{} foreach ($param in $validPrinterParams) { if ($null -ne $printer.$param) { $printerParams[$param] = $printer.$param } } if ($printerParams.Count -gt 0) { Set-Printer -Name $NewPrinterName @printerParams } # Restore configuration $validConfigParams = $printerExtendedConfig.PrinterConfiguration $configParams = @{} foreach ($param in $validConfigParams) { if ($null -ne $printerConfig.$param -and $printerConfig.$param -isnot [System.Management.Automation.PSMethod]) { $configParams[$param] = $printerConfig.$param } } if ($configParams.Count -gt 0) { Set-PrintConfiguration -PrinterName $NewPrinterName @configParams } # Restore properties foreach ($prop in $printerProperties) { if (-not [string]::IsNullOrWhiteSpace($prop.Name) -and $null -ne $prop.Value) { try { Set-PrinterProperty -PrinterName $NewPrinterName -PropertyName $prop.Name -Value $prop.Value -ErrorAction Stop } catch { Write-Warning "Unable to set printer property $($prop.Name): $_" } } } # Restore sharing settings if ($printer.Shared) { Set-Printer -Name $NewPrinterName -Shared $true -ShareName $NewPrinterName } Write-Host "Printer '$NewPrinterName' restored successfully from $BackupFile" return $true } catch { Write-Error "Printer restoration process failed: $_" return $false } } Export-ModuleMember -Function Restore-SinglePrinter Settings.ps1 # settings.ps1 $BaseFolder = "\\testserver\developer\printerBackup" $BackupsFolder = Join-Path $BaseFolder "Backups" Get-PrinterExtendedConfig.psm1 I hoped would be a single place to list all settings to capture. Maybe that is not needed. function Get-PrinterExtendedConfig { return @{ PrinterProperties = @( 'Comment', 'Location', 'Shared', 'Published' ) PrinterConfiguration = @( 'Collate', 'Color', 'DuplexingMode', 'PaperSize', 'Orientation' ) } } Export-ModuleMember -Function Get-PrinterExtendedConfig Find-AvailablePort.psm1 # Find-AvailableIPPort.psm1 function Find-AvailableIPPort { param ( [string]$BaseIP ) $existingPorts = Get-PrinterPort | Where-Object { $_.Name -like "$BaseIP*" } | Select-Object -ExpandProperty Name # If the base IP is not in use, return it if ($BaseIP -notin $existingPorts) { return $BaseIP } # Check for available ports with suffixes for ($i = 1; $i -lt 100; $i++) { $newIP = "${BaseIP}_$i" if ($newIP -notin $existingPorts) { return $newIP } } # If no available port found, create a new one with the next available suffix $maxSuffix = $existingPorts | Where-Object { $_ -match "${BaseIP}_(\d+)" } | ForEach-Object { [int]($Matches[1]) } | Measure-Object -Maximum | Select-Object -ExpandProperty Maximum return "${BaseIP}_$($maxSuffix + 1)" } Export-ModuleMember -Function Find-AvailableIPPort1.5KViews0likes2CommentsAll Windows 11 22H2 print jobs automatically pausing
My company has been upgrading devices from Windows 10 to the latest Windows 11 22H2 build and in doing so, we've ran into a weird issue. All printers, whether locally added or Print to PDF, sends all print jobs to the queue as paused and they won't print without manually resuming. We've opened a ticket with Microsoft and the support rep has hit a dead end just like me. The only printers that seems to work just fine are printers from our Printer Server. Everything else manually added via IP using the correct drivers and Print to PDF automatically pauses. The obvious solution would be to add all of the printers to the print server but the other problem is that this also effects USB printers. We use a variety of printer models so the issue isn't manufacturer specific. We've tried to re-add printers with correct drivers, compare GPO between Win 10 / 11, make sure it's not a WSD port, tried different models with different printers, tried RPC registry fixes and GPO fixes... Has anyone else ran into? If so, do you have a fix?2.2KViews1like2CommentsMicrosoft's PrintNightmare update is causing a lot of problems with network printers
Dears, the latest Windows updates is causing a lot of problems with network printers mapped on a print server. Reference: https://support.microsoft.com/en-us/topic/kb5005652-manage-new-point-and-print-default-driver-installation-behavior-cve-2021-34481-873642bf-2634-49c5-a23b-6d8e9a302872 https://support.microsoft.com/en-us/topic/managing-deployment-of-printer-rpc-binding-changes-for-cve-2021-1678-kb4599464-12a69652-30b9-3d61-d9f7-7201623a8b25 The two recent patches (KB5004945, KB5004760, or KB5003690) causes these two main problems: 1) unable for users without administrative rights to install new print drivers. The end user receive this error 2) unable to use the print server with the new registry key RpcAuthnLevelPrivacyEnabled **The system logs reports this error: 0x0000011b** The two workarounds that you have to apply to survive and allow corporate users to be able to use the print server are: 1) Even if you have a GPO with "Point and Print Restrictions=disabled", you have to apply this registry key to allow non administrative users to install the latest print drivers from the print server HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint RestrictDriverInstallationToAdministrators = 0 2) Apply this registry key to disable the new default settings related to the print spooler vulnerabilities HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print RpcAuthnLevelPrivacyEnabled = 0 The above workarounds are only a temporary solution to survive and allow users to print. What is unclear to me is what should be the right way to manage these settings in a corporate environment without any end user interaction. So, if I want to be protected and apply the recent security fixes without asking the end users to do something, what should I do? Microsoft states that you need to set "RpcAuthnLevelPrivacyEnabled" to "1" on both Client and Print Server in order to be protected, but if you do this, you can't print. So, what should we do in a Corporate environment to be secure and print without any end user interaction about "driver installation" etc.? Thanks in advance2.1KViews0likes2CommentsWindows print server
Hi I have a customer that wants to put his printer server on azure, and remove them onprem, what do you think on this? I would like to know how traffic between client server and printer really works, when a client send a document for printing does this document go to the server and then back to the onprem printer? or does the client send the document to the local printer? thanksSolved4.2KViews0likes11CommentsRemoval of temporary mitigation in Windows updates for printing and scanning devices
A quick reminder that as of August 9, 2022, the security Windows updates removes all temporary mitigation released to all Windows updates between July 27, 2021 and July 26, 2022 for smart card authenticating printers, scanners, and multifunction devices that don’t support either: Diffie-Hellman (DH) for key exchange during PKINIT Kerberos authentication, Or, don’t advertise support for des-ede3-cbc ("triple DES”) during the Kerberos AS request Without this mitigation, smart card authentication (PIV) might fail on non-compliant devices and cause print and scan failures. Firmware on Smartcard-authenticating printers and scanners must be compatible with section 3.2.1 of the https://www.ietf.org/rfc/rfc4556.txt required for https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-33764 prior to installing Windows updates released on August 9, 2022 or later on Active Directory domain controllers. Go to https://support.microsoft.com/en-us/topic/kb5005408-smart-card-authentication-might-cause-print-and-scan-failures-514f0bc5-ecde-4e5e-8c5a-2a776d7fb89a for more information.1.1KViews0likes0CommentsNeed help changing Printer Port Name in Bulk
Hello all, I am in now way a powershell person, I have used other peoples scripts and manipulated to do what I needed but I am stuck on this one and running out of time. I just need to change the portname of roughly 300 printers from "Printer-Name" to "Papercut_Printer-Name" as shown below. i have a .csv file created based off the link below but I feel that I may not need that whole script to do what I am doing (and it errors out anyway), and the technet link below that I am unsure of how to point at a .csv. If anyone could help me that would be great. Thank you very much! https://community.spiceworks.com/topic/1964582-need-script-to-bulk-change-printer-port-ip-addresses-on-2012-r2-print-server https://techcommunity.microsoft.com/t5/windows-powershell/unable-to-change-printer-port/m-p/14434852KViews0likes1CommentPrinter drivers for Windows Server 2019
Hi, I am trying to install HP printer drivers on Windows Server 2019 (2 different office jet models), but they all say that they are not compatible with this Windows version (the setup is detecting Windows 10 64-bit as the OS). Any idea? Does it mean I can't use these printers with Windows 2019? Thanks.28KViews0likes5CommentsPrinting to AAD Devices from onsite server
Hi all, would love some help with this scenario. With many printers connected to a onsite windows print server and these printers are currently assigned locally within GPO. We also have devices on our AAD that need access to printers that are locally connected to the print server at each site. Currently we manually add credentials for the server in windows credentials manager with domain\user and install the printer on the device. Would there be a way to connect this to AAD and have certain users get X printer automatically without the use of an MDM?1.9KViews0likes1Comment