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
69 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article outlines the process to identify and resolve account lockout in an Active Directory environment.
A hard and fast method for reducing Active Directory Administrators members.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
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.

738 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