Hi,
I have just upgraded my old printer server from 2008r2 (TCPRINT01) to 2019 (TCPRINT02), I need to remove all the printers mapper to the old print server from my Windows 10 workstations, I have been trying to find a PowerShell script that can do this but I can only find a script that will remove all printers, can anyone help with a script that will only remove printers connected to TCPRINT01?
I was going to run the script at login unless anyone can recommend a different way to do this?
$printServer = 'TCPRINT01'
Get-Printer | Where-Object {($_.Type -eq 'Connection') -and ($_.ComputerName -match "$($printServer)\b")} | Remove-Printer -Verbose -WhatIf
PS C:\> Get-Printer -Name 'Microsoft*' | select Name, Type, ComputerName
Name Type ComputerName
---- ---- ------------
Microsoft XPS Document Writer Local
Microsoft Print to PDF Local
PS C:\> Get-Printer -Name 'Microsoft*' | Where-Object {($_.Type -eq 'Connection')}
PS C:\>
PS C:\>
you have many kind of script that are doing this migration from server/printer to another server/printer:
https://github.com/carygarvin/Migrate_PrintQs.vbs/blob/master/Migrate_PrintQs.vbs
These scripts can (simply) replace the old printer/server with a new printer during the logon of the user.
Here was my sample script :
https://base.faqexchange.info/TOUTE%20LA%20DOCUMENTATION%20EST%20ICI/Scripting/VbScript/movprinter.vbs.txt
The format file was "SourceServer,SourcePrinte
Only users that were connected to the old shares are modified.