Guest richard Posted January 3, 2007 Report Posted January 3, 2007 We have a simple script which we are trying to use to assign printers to pc's when the user logs on. When the script is run manually it works fine but if we and run it at logon via a group policy it doesn'y work. Anyone got any ideas?
Geoff Posted January 3, 2007 Report Posted January 3, 2007 Are you running it (or a similar script) at machine startup. If not, the PC's wont have the printer drivers loaded on them. Thus the mapping will fail when the users login.
Guest richard Posted January 3, 2007 Report Posted January 3, 2007 Here is the script that we are using: Option Explicit Dim objNetwork, strLocal, strUNCPrinter1, strUNCPrinter2 strUNCPrinter1 = "\\Server1d\Brother HL-5270DN Library 1" strUNCPrinter2 = "\\Server1d\Brother HL-5270DN Library 2" Set objNetwork = CreateObject("WScript.Network") objNetwork.AddWindowsPrinterConnection strUNCPrinter1 objNetwork.AddWindowsPrinterConnection strUNCPrinter2 objNetwork.SetDefaultPrinter "\\Server1d\Brother HL-5270DN Library 1" WScript.Quit
Geoff Posted January 3, 2007 Report Posted January 3, 2007 So are the drivers for the printers on the PCs then?
ChrisH Posted January 3, 2007 Report Posted January 3, 2007 It looks ok but have you checked the issues as Geoff has suggested eg does it run as a logon script after you have run it manually? This would suggest it is a permission issue and you will need to add that script as a startup script as well as suggested. Otherwise there should be some error in the event log.
Guest richard Posted January 3, 2007 Report Posted January 3, 2007 The drivers are installed on the server and pulled down when the printer is installed. I'll try it as a startup script instead of running it at the the logon.
Geoff Posted January 3, 2007 Report Posted January 3, 2007 Normal users do not have sufficient permissions to install/update printer drivers via login script.
Guest richard Posted January 3, 2007 Report Posted January 3, 2007 Normal users do not have sufficient permissions to install/update printer drivers via login script. Even tried it when I login with my account which has administrator privledges and it still doesn't work.
ChrisH Posted January 3, 2007 Report Posted January 3, 2007 Are you sure the script is actually running? Add something like wscript.echo "Script has run" to make sure.
Guest richard Posted January 3, 2007 Report Posted January 3, 2007 Are you sure the script is actually running? Add something like wscript.echo "Script has run" to make sure. The script is running but it still installing the printers
Guest richard Posted January 4, 2007 Report Posted January 4, 2007 Result. After doing a bit of trial and error I have got it working by running it from the "Run these programs at user logon" option in the group policy. For those how don't know where it is here's the path. Computer Configuration - Administrative Templates - System - Logon It now works like a charm. Thanks for all your help.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now