Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Moving print server, need to figure out how to map printers using a script.

Posted on 2008-10-15
13
Medium Priority
?
543 Views
Last Modified: 2012-05-05
Thanks in advance for all your help. You guys are great. I know nothing about creating a script but we are moving the print server to another device. Currently the printers are listed in a directory. I would like to map all the printers using a script. In the AD logon script, there is a logon.cmd and in it points to a vbs of set drives. Can I also add a command to set printers and if so what would the script be.

For example all printers will be on \\server1\      
0
Comment
Question by:microsymplex
13 Comments
 
LVL 11

Accepted Solution

by:
jkarnes12 earned 1500 total points
ID: 22722544
If all of your end-users are already mapped to the correct printers on the orginal server, you can use this software:

http://www.fluentware.com/move_my_printers/downloads.htm

It migrates all of your end users printer to the new location seamlessly.
0
 
LVL 2

Expert Comment

by:mikef147
ID: 22722588
This could possibly be a solution for you:

http://www.petri.co.il/changeprintsrv.htm
0
 

Author Comment

by:microsymplex
ID: 22722704
After looking at how the printers were setup, it looks like I will have to manually add each printer to the new print server then add a script to mapp all the printers for everyone.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Expert Comment

by:igor-1965
ID: 22722965
Correct, as the 1st step you have to add and share printers on the new server (let say \\PRINTServer1) and install printer drivers on this server. Suggest you name printers the same as it were named on the old print server (so the users won't be too confused by migration).

2nd step - you arrange login script to add this shared printer when the user logins to network.

I found that con2prt.exe utility (http://www.paulmcgrath.net/download.php?list.2) is very handy in login scripts. It can flush all the shared printers (con2prt.exe /f) and add another printers from the list.

The example is below (\\%LOGONSERVER%\Scripts$\PRINT\ is the folder where I saved con2prt.exe program and MyPrinters.lst):

\\%LOGONSERVER%\Scripts$\PRINT\con2prt.exe /f
for /f %%i in (\\%LOGONSERVER%\Scripts$\PRINT\MyPrinters.lst) do \\%LOGONSERVER%\Scripts$\PRINT\con2prt.exe /c %%i

MyPrinters.lst contains this lines:
\\PRINTServer1\HP9001
\\PRINTServer1\HP9002
\\PRINTServer1\HP9003

I hope it will help.
0
 
LVL 13

Expert Comment

by:rhinoceros
ID: 22728340
For network printer mapping

(Logon.cmd example)

On error resume next
Set net = CreateObject("WScript.Network")
' Add new network printer
net.AddWindowsPrinterConnection "\\server1\HPLJ123"
net.AddWindowsPrinterConnection "\\server1\HPLJ890"

' Set default printer
net.SetDefaultPrinter "\\server1\HPLJ123"

'Also remove old printer link from users' profile
net.RemovePrinterConnection "\\server1\HPLJZZZ"


I hope it can help !
0
 
LVL 13

Expert Comment

by:rhinoceros
ID: 22728343
Sorry ! it is "logon.vbs" not "logon.cmd"
0
 
LVL 13

Expert Comment

by:rhinoceros
ID: 22728375
(Logon.cmd)
echo off
...
logon.vbs
...


(Logon.vbs)
On error resume next
Set net = CreateObject("WScript.Network")
' Add new network printer
net.AddWindowsPrinterConnection "\\server1\HPLJ123"
net.AddWindowsPrinterConnection "\\server1\HPLJ890"

' Set default printer
net.SetDefaultPrinter "\\server1\HPLJ123"

'Also remove old printer link from users' profile
net.RemovePrinterConnection "\\server1\HPLJZZZ"


***  It will call logon.vbs when you run logon.cmd on AD logon script

0
 
LVL 14

Expert Comment

by:igor-1965
ID: 22728533
Sorry to say rhinoceros, but command processor is not Windows Explorer so logon.cmd won't call logon.vbs directly.
0
 
LVL 13

Expert Comment

by:rhinoceros
ID: 22728571
Why not... it is not physically run on Windows Explorer... now placed to AD logon script.

I always do it by .bat or .cmd extension file to call .vbs file. It's worked.

Have you tried it ?
0
 
LVL 13

Expert Comment

by:rhinoceros
ID: 22728581
You can create these 2 files on your local C: drive, and try to run it....

(logon.cmd)
hello.vbs
pause

(hello.vbs)
wscript.echo "Hello !"

What's result ?
0
 
LVL 14

Expert Comment

by:igor-1965
ID: 22728668
Yes, on my XP home SP3 it works but it doesn't mean it is going to work on other Windows systems (as you can see they were not specified in the question) loging in to domain. Here is what Microsoft suggest how to run scripts from the Command Prompt: http://msdn.microsoft.com/en-us/library/ey73d9d3(VS.85).aspx
0
 
LVL 13

Expert Comment

by:rhinoceros
ID: 22728703
Friend, we are able to use this method on almost windows systems -  Windows XP, 2000, 2003, and Vista... Have you also already tried it on those all Windows systems as you said ?

What's Microsoft suggest ? Do you think Microsoft must have the absolute answer ? The important is that it's work or not.

In the world, nobody can say that "it's absolute answer, no choice"... include Bill Gxxx, rite ?
0
 
LVL 14

Expert Comment

by:igor-1965
ID: 22729350
Perhaps you are right and it will work on most of the Windows versions. But if you look under the "hood" you will see that Windows Explorer is doing it exactly per Microsoft documentation (see screen-shot). Rather than rely on Windows Explorer configuration (which might be changed by firm policies or screwed by the users) I prefer to do it straight.

But this is probably irrelevant to the original question. I have posted the script which is working in my office, you did for your office. It is up to microsymplex to choose what he feels the best way to go.

Clipboard01.jpg
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
Learn about cloud computing and its benefits for small business owners.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

773 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