Solved

Printer Script

Posted on 2009-07-16
5
274 Views
Last Modified: 2012-05-07
I want to setup a GPO to run a script to mount a printer base on computer and not user.  I have a printer script, but it only works when a user logs in.  How would i do it if we use a generic username and the users use that throughout our building.
0
Comment
Question by:TAS-IT
[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
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
laguayoiii earned 84 total points
ID: 24871473

Add this to the Logon Script in GPO (In the Group Policy Editor:  Default Domain Policy\Windows Settings\Scripts (Logon/Logoff)\Logon)

Printers.vbs - Windows Logon Script.
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\Server\PrinterName"

This will run for everybody logging onto the domain.
0
 
LVL 84

Assisted Solution

by:oBdA
oBdA earned 166 total points
ID: 24871638
Use one script in which you check for the computername and map the printers accordingly:

Set wshNetwork = WScript.CreateObject("WScript.Network")
strComputerName = wshNetwork.ComputerName
wscript.echo "Mapping printer for " & strComputerName
 
select case UCase(strComputerName)
  case "WS001"
    wshNetwork.AddWindowsPrinterConnection "\\Server\PrinterWS001"
  case "WS002"
    wshNetwork.AddWindowsPrinterConnection "\\Server\PrinterWS002"
  case else
    wscript.echo "No printers defined for this client, sorry."
end select

Open in new window

0
 

Author Comment

by:TAS-IT
ID: 24871809
HI oBdA,

This script will work as a startup script in the Computer Configuration or a logon script in the User Configuration?
0
 
LVL 84

Assisted Solution

by:oBdA
oBdA earned 166 total points
ID: 24871920
Sorry, should have added that.
Network printer connections are user specific; this script has to run as logon script, a startup script won't make the printers available to the users.
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

This may not be a text book method to resolve VSS backup issues but it seemed to have worked on few of the Windows 2003 servers we had issues while performing a Volume Shadow Copy backup. If you have issues while performing a shadow copy backup usin…
Learn about cloud computing and its benefits for small business owners.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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