Solved

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

Posted on 2008-10-15
13
528 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
13 Comments
 
LVL 11

Accepted Solution

by:
jkarnes12 earned 500 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

627 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