From 5bcbbb10e956f88c93eb88606bba681ab6698460 Mon Sep 17 00:00:00 2001 From: cpi Date: Mon, 20 Apr 2026 11:26:25 +0200 Subject: [PATCH] Drucker per Powershell Managen aktualisiert --- Drucker-per-Powershell-Managen.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Drucker-per-Powershell-Managen.md b/Drucker-per-Powershell-Managen.md index bbb02b5..7e31ac0 100644 --- a/Drucker-per-Powershell-Managen.md +++ b/Drucker-per-Powershell-Managen.md @@ -71,19 +71,23 @@ To rename the printer: `Rename-Printer -Name "Ricoh IM 2702" -NewName "Ricoh_2702" ` + To share a new printer over the network: `Set-Printer -Name "Ricoh IM 2702" -Shared $True -ShareName "Ricoh_2702" ` + Disable printer sharing: `Set-Printer -Name "Ricoh IM 2702" -Shared $False ` + ### List Printers on a Print Server Using PowerShell List the printers installed on a computer: `Get-Printer ` + The command returns the printer names, types (local or network), driver, print port, whether the printer is shared, and whether it is published in Active Directory. Most of the cmdlets in the PrintManagement module can be used to manage printers on remote computers (by using the _-ComputerName_ parameter). @@ -92,10 +96,12 @@ View a list of printers installed on a remote computer (print server): `Get-Printer -ComputerName rome-prnt1 | Format-List Name,DriverName ` + List shared printers on a computer: `Get-Printer -ComputerName rome-prnt1 | where Shared -eq $true | fl Name ` + Get printers that have duplex printing support: `Get-Printer | ForEach-Object { Get-PrintConfiguration -PrinterName $_.Name } | Where-Object { $_.DuplexingMode -ne "OneSided" } @@ -105,23 +111,28 @@ List all the color printers on a computer: `Get-Printer | ForEach-Object { Get-PrintConfiguration -PrinterName $_.Name } | where {$_.Color -eq $True} ` + Enable color printing mode for a printer: `Get-Printer 'HP Color LaserJet 150nw' | Set-PrintConfiguration -Color $true ` + Connect a Network Shared Printer with PowerShell To connect a shared printer from a print server to a computer: `Add-Printer -ConnectionName \\rome-prnt1\HP3027 ` + List the network printers connected to a computer: `Get-Printer | ?{$_.type -eq 'Connection'} ` + Remove a specific network printer connection: `Get-Printer -name \\rome-prnt1\HP3027| Remove-Printer -force ` + Remove all mapped network printers from your computer: `Get-Printer | ?{$_.type -eq 'Connection'} | Remove-Printer @@ -132,6 +143,7 @@ Remove all mapped network printers from your computer: `Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" -Name "LegacyDefaultPrinterMode" -Value 1 –Force ` + Then use the following commands to set the fixed default printer: ``` @@ -146,14 +158,17 @@ To remove a printer, use the command: `Remove-Printer -Name "HP LaserJet M1530" ` + You can then remove the printer driver from the print server: `Remove-PrinterDriver -Name "HP Universal Printing PCL 6" ` + Send a test page for printing: `Invoke-CimMethod -MethodName printtestpage -InputObject (Get-CimInstance win32_printer | Where-Object Name -eq "HP LaserJet M1530") ` + Clear the printer queue: `Get-Printer -Name "HP LaserJet M1530" | Get-PrintJob | Remove-PrintJob