Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Migrating print users from one print server to another help?

Status
Not open for further replies.
Aug 30, 2002
79
IE
HI,

Does anyone know the best way of migrating users from one print server to another. Basically I have 3 file and print servers and I migrated all the print queues on to one server. I am stuck on how I can migrate the users as there is 700 users or more. Has anyone any ideas or know of an application or whatever that may help...

Its an NT4 domain with a mix of 2k and NT4.0 some print servers are nt4 and new print server wk2
 
Just a heads up, when you click on Steve's link, you'll need to remove the "this" from the URL to get to the page.

I'm Certifiable, not certified.
It just means my answers are from experience, not a book.
 
I have migrated the print queues but want to automatically migrate the users too. i. I dont want the users to have to remap printers as this is not ideal for such a large number of users and most are not technical
 
I use ScriptLogic and was able to do it very simply there.
It may be worth it to check out their product for that many users. Heck - I only have 50 users and I benefit greatly from it.

Christine
 
I wrote this in VB, compiled it and ran it on logon.

(Its witten as a one off for my network, you will need to alter the print server names and I think the replaceprintername function).

Will be simple for anyone who has a little programming knowledge. If you get stuck just ask and I will rewrite it for you.

Basically it gets a list of all printers for the logged on user, changes the name of the print server, reconnects, removes any that are not found and resets the default printer to what it was before.

As I say it was written specifically for my network, please test it yourself

Private Sub Form_Load()
On Error GoTo Err_Update
Dim c, i, removecount As Integer
Dim toremove(20) As String

For i = 0 To Printers.Count - 1
If InStr(1, UCase(Printers(i).DeviceName), "BIMMISAARI") Then
toremove(removecount) = Printers(i).DeviceName
removecount = removecount + 1
Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection replacePrinterName(Printers(i).DeviceName)
If UCase(Printers(i).DeviceName) = UCase(Printer.DeviceName) Then
net.SetDefaultPrinter replacePrinterName(Printers(i).DeviceName)
End If
End If
Next i

c = 0
While c < removecount
net.RemovePrinterConnection toremove(c)
c = c + 1
Wend
End
Err_Update:
Resume Next
End Sub

Private Function replacePrinterName(str As String)
replacePrinterName = "\\Panamar" & Mid(str, 13)
End Function


Master of Disaster.....Recovery
 
Thanks guys for all your responses I am very greatful. Both scriptlogic and that vbscript look like good options in refernce to the vbscript the only thing is I only want to migrate XP Users should have mentioned that before. What needs to be done to the script so only XP users will remap. If you could help CANTTHINKOFWHITTYNAME I would be indeed grateful. I have a script but its messy and your looks good can you modify so only XP users will migrate thanks
 
Gave this a quick test seems OK - PLEASE TEST YOURSELF!
You will still need to modify for your oen servernames!


Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (VerI As VerInfo) As Long

Private Type VerInfo
Ver(4) As Long
VerText As String * 128
End Type

Public Win2K_OK As Boolean

Public Function CheckWinVer()
Dim osvi As VerInfo
osvi.Ver(0) = Len(osvi)
GetVersionEx osvi
CheckWinVer = osvi.Ver(3)
End Function

Private Sub Form_Load()
On Error GoTo Err_Update
Dim c, i, removecount As Integer
Dim toremove(20) As String
If CheckWinVer = 2600 Then
For i = 0 To Printers.Count - 1
If InStr(1, UCase(Printers(i).DeviceName), "BIMMISAARI") Then
toremove(removecount) = Printers(i).DeviceName
removecount = removecount + 1
Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection replacePrinterName(Printers(i).DeviceName)
If UCase(Printers(i).DeviceName) = UCase(Printer.DeviceName) Then
net.SetDefaultPrinter replacePrinterName(Printers(i).DeviceName)
End If
End If
Next i

c = 0
While c < removecount
net.RemovePrinterConnection toremove(c)
c = c + 1
Wend
End If
End
Err_Update:
Resume Next
End Sub

Private Function replacePrinterName(str As String)
replacePrinterName = "\\Panamar" & Mid(str, 13)
End Function


Master of Disaster.....Recovery
 
Thats working great except for not recreating the printer its deleting the printer mapping but not recreating and the vbs file is exiting without errors here is what I modified.

Renamed

Private Function replacePrinterName(str As String)
replacePrinterName = "\\Panamar" & Mid(str, 13)
End Function


to
Private Function replacePrinterName(str As String)
replacePrinterName = "\\server2" & Mid(str, 13)
End Function

and renamed

Private Sub Form_Load()
On Error GoTo Err_Update
Dim c, i, removecount As Integer
Dim toremove(20) As String
If CheckWinVer = 2600 Then
For i = 0 To Printers.Count - 1
If InStr(1, UCase(Printers(i).DeviceName), "BIMMISAARI") Then
toremove(removecount) = Printers(i).DeviceName
removecount = removecount + 1
Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection replacePrinterName(Printers(i).DeviceName)
If UCase(Printers(i).DeviceName) = UCase(Printer.DeviceName) Then
net.SetDefaultPrinter replacePrinterName(Printers(i).DeviceName)
End If
End If
Next i

to

Private Sub Form_Load()
On Error GoTo Err_Update
Dim c, i, removecount As Integer
Dim toremove(20) As String
If CheckWinVer = 2600 Then
For i = 0 To Printers.Count - 1
If InStr(1, UCase(Printers(i).DeviceName), "BIMMISAARI") Then
toremove(removecount) = Printers(i).DeviceName
removecount = removecount + 1
Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection replacePrinterName(Printers(i).DeviceName)
If UCase(Printers(i).DeviceName) = UCase(Printer.DeviceName) Then
net.SetDefaultPrinter replacePrinterName(Printers(i).DeviceName)
End If
End If
Next i


Server1 is my old print server server2 is my new one. Any suggestions OH GREAT ONE :) thanks


 
What we do is create an alias (CNAME) record in DNS and use that in the path to the printer. This allows us to move printers and alter all workstations just by changeing the DNS entry. You need to make a reistry change on the print server:-

DisableStrictNameChecking
I know this is too late to help you but it might be of interest for the future.

-------------------------------

If it doesn't leak oil it must be empty!!
 
That is great idea I thought of that with dns but unfortunately we only want to move Xp clients and CantThinkOfWittyName solution looks good but sniff sniff its not working for me fully. But I am sure with his brilliance it will work but thansk for that DNS trick its a good idea.
 
Thats enough of the hero worship, your just setting me up to look daft when it all goes horribly wrong (I don't put master of disaster at the end of my posts for no reason!). To be honest I've just copied and pasted loads of different programs posted on this site to create what I wanted.

Quickly looking I think your problem might be here

Private Function replacePrinterName(str As String)
replacePrinterName = "\\server2" & Mid(str, 13)
End Function

13 refers to the old printer server name + 3 eg:BIMMISSARI has 10 letters \\BIMMISAARI has 12 and \\BIMMISAARI\ has 13, from 13 onwards it copies the printer name and adds it to the new printer

Let me know how you get on!

Master of Disaster.....Recovery
 
Thanks it works great If I played on the other side of the park would kiss yeah but I dont so just may say thanks alot you saved me alot of pain here veryu useful bit of code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top