# Get list of printers from computer "print-server". $Printers = Get-Printer -ComputerName printserver.domain.com # Iterate through the returned list of printers. ForEach ($Printer in $Printers) { # Check to see if the current printer is shared or not. If ($Printer.Shared) { # If it's shared, add it by using the print server name and printer name properties of the current printer object. Add-Printer -ConnectionName "\\$($Printer.ComputerName)\$($Printer.Name)" } } # Get list of printers from local computer. $Printers = Get-Printer # Iterate through the returned list of printers. ForEach ($Printer in $Printers) { # Check to see if the current printer from print server. If ($Printer.Shared) { # Remove network printers that were just added Remove-Printer "$($Printer.Name)" } }