Solved

Rename a networked printer...

Posted on 2010-08-26
5
879 Views
Last Modified: 2012-05-10
Hi,

We have recently joined our parent companies 2008 Active Directory.
We currently have a Windows Server 2000 print server sharing printers to about 50 PC users running XP.

We would like to change the naming convension of our printers i.e. from IT HP LaserJet 2430 > DC1 IT HP LaserJet 2430.
I can do this fine and it lists in Active Directory with the new name. However it breaks the current printer that is setup on a machine already.

Is there a way to rename the printer without the need to visit each machine to set the printer up again?

Thanks!
0
Comment
Question by:Vai777
  • 2
  • 2
5 Comments
 

Expert Comment

by:rlaning
ID: 33532141
This is a nasty problem. All user profiles on all pc's have printer connections to \\server\oldname and these need to be changed into \\server\newname.  As far as I know of, there is no other way to do this (apart from manually) than to run a loginscript that looks at the current printerconnections for this user and replaces them if they do not conform to the new naming pattern.

A similar problem is when all printqueues are moved to another server (with unchanged names).  I used to following script to tackle this :

' ##########################################################################
' #
' # Remap printers : move attached printers from server to be demoted to
' #                  new server
' #
' ##########################################################################

On error resume next

Const OldServer = "oldserver"
Const NewServer = "newserver"

Dim OldPrQ
Dim NewPrQ
Dim CurDefaultPrinter

Set WshNetwork = WScript.CreateObject("WScript.Network")
Set WshShell = WScript.CreateObject("Wscript.Shell")

CurDefaultPrinter = "*** NO DEFAULT PRINTER ***"
CurDefaultPrinter = WshShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device")
If Instr(CurDefaultPrinter, ",") > 0 Then
  CurDefaultPrinter = Left(CurDefaultPrinter, Instr(CurDefaultPrinter, ",")-1)
End If

Set oPrinters = WshNetwork.EnumPrinterConnections
For i = 0 to oPrinters.Count - 1 Step 2
    OldPrQ = oPrinters.Item(i+1)
    If Instr(Lcase(OldPrQ), LCase("\" & OldServer & "\")) > 0 Or _
     Instr(Lcase(OldPrQ), LCase("\" & OldServer & ".")) > 0 Then
      WScript.Echo "Remapping printer connection : " & OldPrQ & " (" & oPrinters.Item(i) & ")"
         ' Remove old printer
         WshNetwork.RemovePrinterConnection OldPrQ, True, True
         If Err.Number = 0 Then
           Wscript.Echo "Removed printer connection " & OldPrQ
           NewPrQ =  Replace( LCase(OldPrQ), LCase("\" & OldServer), LCase("\" & NewServer))
           Wscript.Echo "New printer connection will be : " & NewPrQ
           WshNetwork.AddWindowsPrinterConnection NewPrQ
           If Err.Number = 0 Then              
                 Wscript.Echo "Created printer connection " & NewPrQ
                 If LCase(CurDefaultPrinter) = LCase(OldPrQ) Then
                   WScript.Echo "Setting this printer as default"
                   WshNetwork.SetDefaultPrinter NewPrQ
                 End If
           Else
                 WScript.Echo "ERROR creating printer connection " & NewPrQ
          End If
         Else
         WScript.Echo "ERROR deleting printer connection " & oPrinters.Item(i+1)
        End If
    End If  
                  
Next


I guess you can tweak this to solve your version of this problem....
0
 
LVL 38

Expert Comment

by:Hypercat (Deb)
ID: 33532467
If your users are using Vista or Windows 7 OS on the workstations, you could use the Print Management Console on one of your Windows 2008 servers to deploy the printers through group policy. It's pretty simple and works very smoothly with Win7/Vista - not so smoothly with Windows XP although it is possible with some tweaking. Take a look at this article with links to info on how to do this:
http://technet.microsoft.com/en-us/library/cc754699.aspx
0
 

Author Comment

by:Vai777
ID: 33532675
The users computers are all running XP. The print server itself is running Windows Server 2000.

It might just be easier to do it by department and visit each machine. Its not that many tbh.
0
 
LVL 38

Accepted Solution

by:
Hypercat (Deb) earned 250 total points
ID: 33532823
Yeah - with XP and Windows 2000, you don't have a lot of choices - two in fact: scripting as described by rlaning, or visiting each machine. IME, creating and troubleshooting a script for a relatively small number of machines is usually more trouble than it's worth. One thing you could do to make your like a bit easier would be to do the change manually on one machine, then export the applicable registry entries and use that .reg file to import on all the other machines. That way you don't have to do the whole process manually on each machine.
0
 

Author Closing Comment

by:Vai777
ID: 33586442
Decided that it would be easier to rename the printers and set them up manually again.
0

Join & Write a Comment

Installing a printer using group policy preferences is not that hard let’s take a look at it. First lets open up your group policy console and edit the policy you want to add it to. I recommend creating a new policy for each printer makes it a l…
Synchronize a new Active Directory domain with an existing Office 365 tenant
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 transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

747 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

12 Experts available now in Live!

Get 1:1 Help Now