Link to home
Start Free TrialLog in
Avatar of alliancemkt

asked on

2003 to 2008 print migrations - DNS issue

Hello everyone,
I am in the process of migrating from a 2003 32 bit print server to a "multi-function" 2008 R2 64 bit print server.  It will be a DC, DHCP and DNS later.  (Forced consolidation)  For now, the focus is printers.  I used the print migration tool after I added all the 64 bit drivers, so both 32 and 64 would move.  Tested the new setup from a 32 and 64 bit workstation and all is good.  Now I want to seamlessy move all the users (~100) to the ~40 printers without having to touch every desktop.  I am *thinking* that I can just delete the Host(A) record of the old print server and create a new Host(A) record, then put in an alias from the old to the new name.  What else do I need to do in DNS?  Microsoft said something about registering with the KDD or there may be some errors.  Can I just delete, create, alias and go?

Am I leaving any "force update" etc. out of the procedure?

Avatar of neilpage99
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alliancemkt


Thanks for the scripts, but I thought that this could be accomplished through changes in DNS. For example, remove the old Host(A) record and add a CNAME alias pointing to the new host?  Are there any 'step by steps' out there that can make this seamless for the users?

Nope, that won't work. In the end, the clients have to be updated. My script works perfectly, I used it to update a ton of clients to the new print server.

By the way, premglitz link above won't work - I tried it before polishing the script I ised.
OK.  I wasn't sure if the DNS CNAME idea was the route to take.

Thanks for the feedback, neilpage99.  I am a COMPLETE noobie to scripts.  From the looks of your (impressive) script, it appears that I only have to change the first two lines after the "="to the names of the old printer server and the new print server.  Is this all I have to change?  what is the "standalone" mode?  Is that to test it locally before adding it to the login?  How do I make it only run once or do I just leave it for a week, then after everyone has re-started, remove it?

Thanks in advance for your help.......
That script can and was used in conjunction with other properties and procedures; but that doesn't relate to you.

Yes, simply change the 'old' and 'new' print server to meet your needs. I call the script from a logon.bat script that each of my domain users have designated in their user account properties.

Here's an example of how to invoke it:

1. Make sure each user (that you want to update) has a "Logon script" designated in their "Profile" tab of their user properties in Active Directory Users and Computers (ADUC).

2. The "Logon script" can be several different things, I use a simple "logon.bat" file that maps network drives to important company resources, then launches the "update-printers.vbs" VBS script at the end. (that last part is what updates the user's printers to the new print server - which is the script I posted above.)  My logon.bat file would look similar to this:
NET USE G: \\server01\someapplication /persistent:yes
NET USE P: \\mycompany.local\general\departments /persistent:yes

cscript \\mycompany.local\SYSVOL\mycompany.local\scripts\update-printers.vbs

Open in new window

3. Both the "logon.bat" script and the "update-printers.vbs" script are placed in the:
...folder  This is a special folder that is replicated to all domain controllers in the domain. Your exact path will be different, but you get the idea.

4. When a user logs on to ANY computer/server, the logon script fires, which in turn will fire the update-printers.vbs script.

Yes, I left the scripts as they were for quite a while, just in case people were on vacation, out sick etc. It doesn't hurt anything to run the scripts on the same user over and over - but eventually, to be thorough, you will want to stop executing the update-printers.vbs script.
It sounds good so far!  Another quetions.  What if I want to take the opportunity during the migration to change the printer names?  Should I leave them as they are or does the script use the IP address??  Sorry, I am trying to grasp the script 'concept'.

oops.  just to confirm.  I never noticed if the registry key is the same for XP, Win 7, 32 bit, 64 bit.  Is this an issue?
I think I comprehend the script commans for the printer and it does seem to look at the printername, so I will leave the names the same for the migration.

Thanks again for your patience and guidance!
Yes, this works for XP through Windows 7 64-bit or 32-bit.
Yes, the printer names must stay the same for the script to work.
okay.  I'll be testing out on a couple of PCs then roll it out.  Will let you know.

Hi neilpage99,

I tested the VB script on my login and it didn't update my printers.  I have a WIN 7 and an XP test machine and neither updated.  I see the command running. Event log "Application" says Windows detected your registry file is still in use by other applications or services.  The applications or services that hold your registry file may not function properly afterwards.

I went back to the registry keys the VB Script should change and it still shows the old print server.

The VB script is in the "scripts" folder under sysvol and I tested the path by accessing it.
The command line is added to the login.bat file with our path in it.

Am I doing something wrong?
Start by saving the update-printers.vbs to your local test computers. Open a command window and change to the directory in which the script resides. Run the script from there; usually by typing the name of the script.

What happens?

The error you mentioned in the Application log might not be related.
Ok. I think I didn't do something I should have.  In the script you have a command line for "standalone".  I am assuming that I have this set wrong.  If it is on a DC, should that be "Commented" instead of Uncommented?

'Uncomment the next line for a standalone version of this script
Set WSHNetwork = WScript.CreateObject("Wscript.Network")

Should be?

'Uncomment the next line for a standalone version of this script
'Set WSHNetwork = WScript.CreateObject("Wscript.Network")
ok.  I tried it localy on the WIN7 pc and it worked.  So the script runs!  Excellent.

Now I just need to get it to run through the login.bat.

Is the issue with the "Uncomment" I mentioned above?
The only things you needed to change on the script were the names of the old and new print servers - everything else should remain the same. No need to make line 7 (way above) a comment, leave it uncommented.

Next, make sure the "USER" has in their AD User properties the correct logon.bat script identified, and that logon.bat script exists in the 'SYSVOL\mycompany.local\scripts\' folder.

Make sure at the end of the logon.bat file, the printers script is called in the form of:
cscript \\mycompany.local\SYSVOL\mycompany.local\scripts\update-printers.vbs

'cscript' being a critical part of the call.
It Worked!  thanks for the clarification.  I was using "\\Windows\SYSVOL........" instead of  "mycompany.local\SYSVOL\mycompany.local" portion.

thanks alot.  You sved me alot of work!!
Great job - and very patient with a 'noobie' to scripting.....  Thanks!