Solved

Printer Script

Posted on 2009-07-16
5
264 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
  • 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 82

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 82

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

707 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

15 Experts available now in Live!

Get 1:1 Help Now