Printer Script

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.
TAS-ITAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
laguayoiiiConnect With a Mentor Commented:

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
 
oBdAConnect With a Mentor Commented:
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
 
TAS-ITAuthor Commented:
HI oBdA,

This script will work as a startup script in the Computer Configuration or a logon script in the User Configuration?
0
 
oBdAConnect With a Mentor Commented:
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
All Courses

From novice to tech pro — start learning today.