We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Migrating printers from one server to another

Medium Priority
549 Views
Last Modified: 2013-11-21
Hi everyone,

We have migrated our printers from our old print server to a newly build one. I used printmig.exe for the migration. After the migration I changed the dns to point to the new server. My problems is most of the users working on terminal servers printers still point to the old server(server name) and not the dns entry. Is there any way to fix this without deleteing the printers maunually from the users profile and reconnect to the correct server.
Comment
Watch Question

Commented:
Download the Microsoft Print Migrator utility.
http://www.microsoft.com/downloads/details.aspx?FamilyID=9b9f2925-cbc9-44da-b2c9-ffdbc46b0b17&DisplayLang=en
Backup our printers and then restore on your new server.
Easy as that.

Commented:
Sorry only read have your question..
The second part, use Con2prt.exe to remove/readd the new printers:
http://support.microsoft.com/kb/181663

Add it to login script.
To delete all network printer
con2prt /f

Add printer:
con2prt /c \\YOUR-SERVER\PrintQueue
or
con2prt /cd  \\SERVER\QUEUE

using /cd option installs as default printer

Author

Commented:
This is the utility I used. The printers migrated fine, but on the TS client they still point to the old server name and not the DNS which was always used.

Commented:
You can download it in the Zero Administration Kit from microsoft http://download.microsoft.com/download/2/6/0/260afc88-2253-45f8-9781-546cff07edd9/zak.exe
Unzip it and you will find con2prt.exe in \i386\tools\
Network connected printers are stored on a per-user basis and I would suggest that you write a script that you run one time on logon, where you look at the printers mapped and if you see the old printserver name you disconnect that printer mapping and creates a new one with the new print server name (I assume that the printer names are the same).
I wrote a quick script that will do what you want but some error checking might be in place to add, this will loop through all network attached printers on a machine and delete them if they match "old printserver name" and ad the same with the new print server name, it will also set the new one as default if the old one was default.
of course you can change so the variables strOldPrintServer and strNewPrintServer is name of the print queue instead (with some smaller adjustments).
Just put the code below in a .vbs file and run them with cscript on logon (maybe from a .cmd file)
Good luck!
/ Mikael

Set objNetwork = WScript.CreateObject("WScript.Network")
 
strOldPrintServer = "\\Server1" ' Including \\ before name
strNewPrintServer = "\\Server2" ' Including \\ before name
 
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
 
Set colInstalledPrinters =  objWMIService.ExecQuery _
    ("Select * from Win32_Printer where Local = false")
 
wscript.echo "loop through"
'Loop through all network connected printers on the local machine
For Each objPrinter in colInstalledPrinters
  if objPrinter.ServerName = strOldPrintServer then
    strNewPrtName = Replace(objPrinter.Name,strOldPrintServer, strNewPrintServer)
    ' Removes the old printerconnection
    objNetwork.RemovePrinterConnection objPrinter.Name
    ' Add a new printer pointing to strNewPrintServer
    ' Note! No error handling if printer does not exist, then mapping fails
    objNetwork.AddWindowsPrinterConnection strNewPrtName
    ' If the deleted network printer connection was default, set the new one
    if objPrinter.Default = True then
      objNetwork.SetDefaultPrinter strNewPrtName
    end if
  end if
Next

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Commented:
Choosing a Printer Migration Method:

http://technet.microsoft.com/en-us/library/cc780640.aspx
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.