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
70 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
[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
  • 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

In-place Upgrading Dirsync to Azure AD Connect
Here's a look at newsworthy articles and community happenings during the last month.
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 …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

690 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