kinji5
asked on
Permission denied when adding Printer using VBS script in Users Logon via Group Policy
I am trying to deploy printers via Group Policy on Windows 2003 Server to Windows XP Pro client on the same domain. I call the printer.vbs script from a logon.bat file in the User Configuration -> Windows Settings -> Scripts -> Logon
The script will launch but I get a "Permission Denied" on Line 5.
If I log on as domain admin on the client and run the script it will map the printers. Then I go back and log on as user it will map. Is there a printer policy I need to enable/disable?
Thanks
/------------Begin Script-----------/
Dim objNetwork
Dim strUNCPrinter01
strUNCPrinter01 = "\\ServerIP\PrinterShareNa me"
Set objNetwork = CreateObject("WScript.Netw ork")
objNetwork.AddWindowsPrint erConnecti on strUNCPrinter01
objNetwork.SetDefaultPrint er strUNCPrinter01
WScript.Echo "Check the Printers folder for : " & strUNCPrinter01
WScript.Quit
/------------End Script-------------/
The script will launch but I get a "Permission Denied" on Line 5.
If I log on as domain admin on the client and run the script it will map the printers. Then I go back and log on as user it will map. Is there a printer policy I need to enable/disable?
Thanks
/------------Begin Script-----------/
Dim objNetwork
Dim strUNCPrinter01
strUNCPrinter01 = "\\ServerIP\PrinterShareNa
Set objNetwork = CreateObject("WScript.Netw
objNetwork.AddWindowsPrint
objNetwork.SetDefaultPrint
WScript.Echo "Check the Printers folder for : " & strUNCPrinter01
WScript.Quit
/------------End Script-------------/
ASKER
Would I have to do this from individual machines or is it a policy I can set from the server?
No,
Open up your domain security policy, or default domain GPO.
Navigate to: Computer Configuration\Windows Settings\Security Settings\Restricted Groups
Add the domain users group as a member of the print operators group.
GPUpdate
/F
Open up your domain security policy, or default domain GPO.
Navigate to: Computer Configuration\Windows Settings\Security Settings\Restricted Groups
Add the domain users group as a member of the print operators group.
GPUpdate
/F
This post might help:
https://www.experts-exchange.com/questions/22830115/Help-with-Group-Policy.html
https://www.experts-exchange.com/questions/22830115/Help-with-Group-Policy.html
ASKER
/F
I tried your suggestion fo "Try adding the domain users group to the local print operators group (XP)."
I am still getting an error.
some one recommended me to try use.
As an alternative to the the vbscript you posted check out prnmngr.vbs in the system32 folder
To map printer:
cscript "%SYSTEMROOT%\system32\prn mngr.vbs" -ac -p "\\SERVERNAME\PRINTERSHARE "
To make the printer default:
cscript "%SYSTEMROOT%\system32\prn mngr.vbs" -t -p "\\SERVERNAME\PRINTERSHARE "
I tried your suggestion fo "Try adding the domain users group to the local print operators group (XP)."
I am still getting an error.
some one recommended me to try use.
As an alternative to the the vbscript you posted check out prnmngr.vbs in the system32 folder
To map printer:
cscript "%SYSTEMROOT%\system32\prn
To make the printer default:
cscript "%SYSTEMROOT%\system32\prn
Are you still game for some help? I know it's been a while for a response.
ASKER
Yes, i still need assistance. I am still getting permission denied.
Let me recruit someone better at a script than I am.
User's can't run wscript or cscript.
You can try using Printui.dll to do this:
rundll32 printui.dll PrintUIEntry /in /n\\machine\printer
You can try using Printui.dll to do this:
rundll32 printui.dll PrintUIEntry /in /n\\machine\printer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks Netman( |:^} >
Try adding the domain users group to the local print operators group (XP).
/F