Solved

I have an old print server that is Windows 2003. I need to map printers usering a login script...any suggestions?

Posted on 2016-08-02
6
53 Views
Last Modified: 2016-08-08
I have a branch that still has an old 2003 print server. I cannot add Print Management to it. I need to simply add 3 printers to each user's login script. I forgot the syntax. All suggestions welcome..should i stick with .bat or use vbs?
0
Comment
Question by:Thor2923
  • 3
  • 3
6 Comments
 
LVL 4

Expert Comment

by:Niabingi
ID: 41739234
On Error Resume Next
Dim netPrinter, newprt1
Set netPrinter = CreateObject("New-Object -Com WScript.Network")
newprt1 = "\\printserver\printer"
newprt2 = "\\printserver\printer"
netPrinter.AddWindowsPrinterConnection newprt1, True
netPrinter.AddWindowsPrinterConnection newprt2, True
netPrinter.SetDefaultPrinter "\\printserver\printer"



you can set it in the startup folder so it runs when the user logs in
0
 
LVL 1

Author Comment

by:Thor2923
ID: 41739275
AMAZING! thanks...so is that a VBS i call from the .bat file or can I just put that code in the .bat?
0
 
LVL 1

Author Comment

by:Thor2923
ID: 41739442
ooops I just read your last line about the start up folder. I was hoping to call this or make this the .bat file that users in a local office have for a login script. Will this work?
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 4

Accepted Solution

by:
Niabingi earned 500 total points
ID: 41739793
for the batch file this should work


@Echo Off


Add printer
rundll32 printui.dll,PrintUIEntry /in /n\\printserver\printer

Set printer as default
rundll32 printui.dll,PrintUIEntry /y /in\\printserver\Printer






OR powershell

$PrinterPath = "\\PRINTSERVER\PRINTER"
 $net = new-Object -com WScript.Network
 $net.AddWindowsPrinterConnection($PrinterPath)
0
 
LVL 1

Author Comment

by:Thor2923
ID: 41740553
oh thanks....is there an advantage to using Powershell? is there a way to bypass the install if the printers are already mapped? I am still in early testing, but it appears that workstations will go through quite an extensive install process on every reboot. I guess the work around is to change the login script after a user is initially setup, but if I could make it more permanent that would be great
0
 
LVL 4

Expert Comment

by:Niabingi
ID: 41740648
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

When I recently replaced my image transfer kit on my office HP color laserjet 5550dn printer, I had a slight problem.  The left bracket that holds the transfer kit got stuck in the upright locked position instead of being at a 45 degree angle facing…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

910 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

21 Experts available now in Live!

Get 1:1 Help Now