Quantcast
Channel: Group Policy forum
Viewing all articles
Browse latest Browse all 19997

Add-Network-Printer VBS is not working in GPO

$
0
0

Windows Server 2008 R2 standard as the printer server, 

Windows Server 2003 domain  functional level.

I have a vbs script to map network printers. It works on the windows 7 client wioth printer previously installed.

I added to GPO --computer settings --windows ---startup logon . Also add it to netlogon but just won't work.

' Script to add printers during user logon
On Error resume Next ' ver important otherwise users will get errors on subsequent reconnections
' Create the variable to hold printer connections

Dim objNetwork
Set objNetwork = CreateObject("WScript.Network")

'objNetwork.RemoveWindowsPrinterConnection "\\server\printer_to_remove"
'objNetwork.RemoveWindowsPrinterConnection "\\server\2nd_printer_to_remove"

objNetwork.AddWindowsPrinterConnection "\\dc1\printer1"
'objNetwork.SetDefaultPrinter "\\dc1\printer1"

Set objNetwork = Nothing

 

Please help. Can you see the vbs is correct?


Viewing all articles
Browse latest Browse all 19997

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>