Announcement

Collapse
No announcement yet.

Migrating printers

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Migrating printers

    I am moving our print servers from old NT4 servers (5 of them) onto 1 Win 2003 server.

    I used the Microsoft Printer Migration tool to backup the printers on all the old servers and restore all the printers required to the new server. So far so good and if I manually change the printer shareon a workstation, it all works fine.

    However, as I didn't want to visit all the workstations (around 300) to change the share settings so they get the new server name, I used changeprintsrv that I found on this site to change the client settings.

    Once run, everything seemed OK, but for clients I've tested it with, it gives me an access denied: unable to connect error, unless I am an domain administrator (not local).

    This has also now affected the printers I added manually, so no one can access those printers.

    I have tried looking at the security settings, but I can't see anything obvious that I am missing.

    Is there anything anyone can think of, or does any one know about the changeprintsvr application?

    Is there a difference between sharing printers on NT4 and going to WIN2K3?

    Thanks for reading and hope you can help!

  • #2
    Re: Migrating printers

    Have you use the search button?
    I don't think so.

    There are quite a lot of scripts in the scripting forum where you can find enough examples how to migrate printers for the clients.
    Basically.

    read out the default printer
    delete all printers.
    add new printers
    set default printers

    For example:
    http://forums.petri.com/showthread.php?t=14014
    Marcel
    Technical Consultant
    Netherlands
    http://www.phetios.com
    http://blog.nessus.nl

    MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
    "No matter how secure, there is always the human factor."

    "Enjoy life today, tomorrow may never come."
    "If you're going through hell, keep going. ~Winston Churchill"

    Comment


    • #3
      Re: Migrating printers

      Originally posted by Dumber View Post
      Have you use the search button?
      I don't think so.
      Actually, yes, I did do some searches, as I always do.

      I was just hoping to resolve the issue without resorting to scripts, which I know very little of. Add to the fact that I think the changeprintsrv has changed something on my print server already and I don't really want to start running scripts I know nothing about.

      And certainly when the script you pointed me to (and one that I'd already seen) was still a work in progress and not something I'd like to put in my production environment.

      Comment


      • #4
        Re: Migrating printers

        Like I said, therre are many more.
        This one worked however he is never implemented in production.

        The admin choose rather to walk to every client (about 300) then running the script. So I'm not quite sure how it would run in a live environment.
        However, most parts of the script are usable.
        Marcel
        Technical Consultant
        Netherlands
        http://www.phetios.com
        http://blog.nessus.nl

        MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
        "No matter how secure, there is always the human factor."

        "Enjoy life today, tomorrow may never come."
        "If you're going through hell, keep going. ~Winston Churchill"

        Comment


        • #5
          Re: Migrating printers

          Originally posted by Dumber View Post
          Like I said, therre are many more.
          This one worked however he is never implemented in production.
          I have searched the scripts forum and while I can see a few scripts, there's nothing there that jumps out at me. I see your script there and another that might be OK, but I have limited scripting skills, so am a little apprehensive about it.

          I'll go through a few of the scripts and see what I can learn and then test a few things out.

          Just can't believe that something like this isn't more easily resolved!

          Comment


          • #6
            Re: Migrating printers

            FWIW, I tend to email users with a list of links in the form \\servername\printersharename and let them do it themselves to pick the most suitable printers for them. Combined with a script to do something like:
            IF servername = \\nt4server THEN delete printer, this should do the trick!
            Tom Jones
            MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
            PhD, MSc, FIAP, MIITT
            IT Trainer / Consultant
            Ossian Ltd
            Scotland

            ** Remember to give credit where credit is due and leave reputation points where appropriate **

            Comment


            • #7
              Re: Migrating printers

              Actually, even forgetting about scripting to change the share name, right now, even if I add a new printer as administrator and then log on as the user, it says :

              access denied: unable to connect

              What could be causing that? It only seems to be after I ran the changeprintsrv application, but I only did that on a different workstation, not the one I am trying to add a new printer to now.

              So, if I add a new printer to the print server, share it and try and connect, it works as I do it, but not for users. Also, if I manually change the users printers to the new share, that gives me the same problem.

              If I make the user a domain admin, the printer works, but if I just give them full rights to the printer, it doesn't work. Obviously I don't even want to do that, but the print only right isn't working anyway.

              Is there something different in WIN2K3 that I need to change, coming from an NT4 environment?

              Any ideas?

              Comment


              • #8
                Re: Migrating printers

                Just do a search on google and you'll find many examples.
                What I did was create a logon script which would list all the network printers the user had installed, delete and only install the ones which were installed.

                Here is the script I used

                Const ForWriting = 2

                Set objNetwork = CreateObject("Wscript.Network")

                strName = objNetwork.UserName
                strDomain = objNetwork.UserDomain
                strUser = strDomain & "\" & strName
                strComputer = "."
                strNewDomain = "\\[newserver]"

                Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

                Set colPrinters = objWMIService.ExecQuery _
                ("Select * From Win32_Printer Where Local = FALSE")

                For Each objPrinter in colPrinters
                strText = objPrinter.Name
                prtname = Mid(strtext,9)
                oldptr = Left(strtext,9)
                if oldptr = "\\[oldserver]\" then
                objNetwork.RemovePrinterConnection strtext
                objNetwork.AddwindowsPrinterConnection strNewDomain & prtname
                End if
                if strtext = "\\[newserver]\[printername]" then
                objNetwork.RemovePrinterConnection strtext
                objNetwork.AddwindowsPrinterConnection "\\[newserver]\[printername]"
                End if
                Next

                Comment


                • #9
                  Re: Migrating printers

                  OK guys, after many searches and deep breathes, I think I've found a script that does what I want. However, can someone take a look and make sure it isn't doing anything wrong that may break my environment.

                  I've tried it in a lab and it seems to work fine, all I want it to do is change the print server name from oldserver(s) to newserver and keep the default printer.

                  I got the script from here. The code is below :

                  Code:
                  On Error Resume Next
                  Function GetDefaultPrinter()
                  sRegVal = "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device"
                  sDefault = ""
                  On Error Resume Next
                  sDefault = objShell.RegRead(sRegVal)
                  sDefault = Left(sDefault ,InStr(sDefault, ",") - 1)
                  On Error Goto 0
                  GetDefaultPrinter = sDefault
                  End Function
                  
                  Set objNetwork = CreateObject ("Wscript.Network")
                  Set objShell = CreateObject ("WScript.Shell")
                  Set objFSO = CreateObject ("Scripting.FileSystemObject")
                  
                  LogonServer = objShell.ExpandEnvironmentStrings("%logonserver%")
                  UserName = objShell.ExpandEnvironmentStrings("%username%")
                  
                  strComputer = "."
                  PrintServer = "NEWSERVERNAME"
                  PrintServer = LCase (PrintServer)
                  
                  Err.Clear
                  Set objWMIService = GetObject("winmgmts:" & _
                  "{impersonationLevel=Impersonate}!\\" & strComputer & "\root\cimv2")
                  
                  If Err.Number Then
                  wscript.echo ("Error : " & Err.Number & ": " & Err.Description & VbCrLf)
                  Err.Clear
                  
                  Else
                  ImpDefault = GetDefaultPrinter
                  Set colInstalledPrinters = objWMIService.ExecQuery _
                  ("SELECT * FROM Win32_Printer")
                  For Each objPrinter in colInstalledPrinters
                  PrinterArray = Split (objPrinter.Name , "\")
                  
                  If (LCase(objPrinter.ServerName) <> "") and (LCase(objPrinter.ServerName) <> "\\" & PrintServer) then
                  
                  objNetwork.AddWindowsPrinterConnection "\\" & PrintServer & "\" & PrinterArray(3)
                  If Err.Number Then
                  wscript.echo ("Error : " & Err.Number & ": " & Err.Description & VbCrLf)
                  Err.Clear
                  End If
                  
                  If ImpDefault = objPrinter.Name then
                  objNetwork.SetDefaultPrinter ("\\" & PrintServer & "\" & PrinterArray(3))
                  End If
                  
                  objNetwork.RemovePrinterConnection objPrinter.Name
                  End If
                  Next
                  End If
                  Thanks for any help!

                  Comment

                  Working...
                  X