Re-mapping printers after mass computer rename

Posted on 2009-04-22
Last Modified: 2012-05-06
Hi everyone :)

This is my first question here. I'm looking for ideas because I have hit a wall. I need to rename 1500 computers (all are domain members). You already see where this is going - mass rename would be devastating for users that have mapped connections to printers shared on other computers. My initial idea was to use a script and rename all 1500 computers in one go. But hundreds of users not being able to print would mean riots.

So far I have been unable to figure out a way to re-map or update the user's existing printer mappings in accordance with the new names of computers. Since mapped printer connections are stored in the registry, I was thinking of exporting "HKCU\Printers\Connections" key, updating the exported file with a script and importing it back. This is how an export looks like:

[HKEY_CURRENT_USER\Printers\Connections\,,computer123,HP LaserJet 4L]

The script would need to add a prefix to "computer123", save the file and import it into the registry. Is there any way this could be done?

Any other suggestions on how to approach this problem?

Many thanks :)
Question by:aLienat3d
    LVL 15

    Expert Comment

    I take it that these printers are local to the computers?  How many printers are we talking about?  You might be better off setting up a dedicated print server and putting the printers on the network (or replacing them with commercial printers).  2003 R2 has a method for publishing printers using GP.  I suppose you could do the same thing after the computer rename.

    May I ask why you're renaming 1500 computers?  Is this something that could be handled through CNAME records in DNS?  Then as you roll out new computers you could use your new naming convention, but not touch the existing ones.


    Author Comment

    Yes, the printers are local to the computers and there's 100 or so of them. I was thinking of setting up a print server, but I don't have any hardware available. Existing servers are overloaded as is and there is no chance of getting new ones since the budget cuts. :(

    As for the renaming, I'm doing it because AD is a mess. Regional offices have their administrators who didn't exactly adhere to our naming conventions. I'm hoping that this new naming convention along with security policies will keep them in line. Also, there is a chance that we could be joining a new corporation-wide forest with multiple domains and this new naming policy would identify our computers more transparently. Therefore, I need the renaming done in a relatively short amount of time.
    LVL 3

    Expert Comment

    Could you clarify if you are simply adding a prefix to all 1500 pc's?  So if the prefix is like "na" then all of your pc's will be naComputer123, naAnything and so forth?  I mean you are not doing something like a different prefix for different departments?
    LVL 15

    Accepted Solution

    Do you have any spare workstations (if you have 1500, you must have something sitting around!)?  You could install a server product on one and use it (or depending on volume) a few of them as print servers.  You're already relying on workstation class machines for printing, the fact that it (they) wouldn't be a server class machine shouldn't be an issue.  This would simplify it going forward, too.  

    Another thing you may want to consider that if you may be joining a new corporate wide forest, they may have their own naming convention that they would like you to adhere to.  In which case you may end up changing names more than once.  

    Good luck, it sounds like geewilly may have an answer for you.

    Author Comment

    geewilly, yes - I'm adding a prefix to computer names. Not one but seven different ones that follow the same logic. One letter defining my company, two letters defining a region (or OU) the computer is located in and a dash to separate the prefix from the current computer name. Grand total of 1500 computers, 900 of which are in our headquarters. Those are the trickiest ones and if I could find a solution for them I could apply it to other OU's as well.

    zelron22, I took the idea of print servers more seriously once you've mentioned it. Installing Server 2003 R2 as a print server and deploying printers from it sounds like a good idea. As for the corporate-wide forest, they don't have any written naming conventions. XD
    LVL 3

    Assisted Solution


    Yeah, print servers would by far be the best solution.  If it were just a matter of adding the same prefix to all pc's then a vbs would not be that difficult.  Giving your situation though a vbs would be pretty tricky and clever because you wouldn't know which prefix you used on a pc that had the printer setup locally on.  Unless you made an array that identified all pc's that have a printer locally setup on and what their prefix is going to be and then when you changed peoples printer mappings you would just refer to that array.  If you choose to go vbs way then let me know and I can probably work through it with you.

    Author Comment

    I was thinking a script could add a designated prefix in the first and second line of the registry export. Then again, there are computers that have 2 or more mapped printers... Not to mention my complete lack of scripting skills.

    Thank you both for the help. :))

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Mapping Drives using Group policy preferences Are you still using old scripts to map your network drives if so this article will show you how to get away for old scripts and move toward Group Policy Preference for mapping them. First things f…
    Learn about cloud computing and its benefits for small business owners.
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
    This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now