What is the script?
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?
What is the script?
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.
Here is the script that we are using:
Code: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
So are the drivers for the printers on the PCs then?
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.
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.
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.Originally Posted by Geoff
Is anything logged in the event log?
Are you sure the script is actually running? Add something like
to make sure.Code:wscript.echo "Script has run"
The script is running but it still installing the printers :cry:Originally Posted by ChrisH
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)