?
Solved

Printer Script

Posted on 2009-07-16
5
Medium Priority
?
277 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 336 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 85

Assisted Solution

by:oBdA
oBdA earned 664 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 85

Assisted Solution

by:oBdA
oBdA earned 664 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

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,…
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

718 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