Solved

Printer Script

Posted on 2009-07-16
5
273 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 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

861 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