MIGRATE PRINTERS TO NEW SERVER
A Powershell script in the Printers category
Function Migrate-Printer { PARAM ( [string] $ShareName, [string] $oldServer, [string] $newServer ) $currentPrinter = Get-WmiObject -Query "SELECT * FROM Win32_Printer WHERE Network=True AND ShareName = '$($ShareName)' AND SystemName = '\\\\$($oldServer)'" if ($currentPrinter -eq $null) { Write-Verbose "Cant find \\$($oldServer)\$($ShareName)" } else { Write-Verbose "Migrating printer $($ShareName) from $($oldServer) to $($newServer)" $net = New-Object -com WScript.Network Write-Verbose "Adding printer \\$($newServer)\$($ShareName)" $net.AddWindowsPrinterConnection("\\$($newServer)\$($ShareName)") Write-Verbose "Removing printer \\$($newServer)\$($ShareName)" $net.RemovePrinterConnection("\\$($oldServer)\$($ShareName)") if ($currentPrinter.Default -eq "True") { Write-Verbose "Setting default to \\$($newServer)\$($ShareName)" $net.SetDefaultPrinter("\\$($newServer)\$($ShareName)") } } }