OK, this is driving me nuts. I have two scripts. Here they are:
[red]serverroomprinter.vbs[/red]
and
[red]noserverroomprinter.vbs[/red]
They are assigned in the login script of the user config part of a GP that is linked to an OU that I put computer objects in (basically I want machines in a specific location to have a certain default printer regardless who logs in). We do not use roaming profiles.
RSOP shows that the policy was applied but the printer does not show up, nor does the msg box.
If I run the script on a wkstn it functions just fine.
If I put the script in the "run this program on startup" part of the machine GP it functions also but the user gets a warning with XP SP2 before the vbs runs (and they can stop it of course).
Any pointers as to what I am missing?
Marty
Network Admin
Hilliard Schools
[red]serverroomprinter.vbs[/red]
Code:
Dim objNetwork, strPrinterPath
strPrinterPath = "\\HCSD-SSF\SVRROOM"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strPrinterPath
objNetwork.SetDefaultPrinter "\\HCSD-SSF\SVRROOM"
MsgBox "Connected Default Printer: " & strPrinterPath
Wscript.Quit
and
[red]noserverroomprinter.vbs[/red]
Code:
Dim objNetwork, strPrinterPath
strPrinterPath = "\\HCSD-SSF\SVRROOM"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.RemovePrinterConnection strPrinterPath
MsgBox "Removed Printer: " & strPrinterPath
Wscript.Quit
They are assigned in the login script of the user config part of a GP that is linked to an OU that I put computer objects in (basically I want machines in a specific location to have a certain default printer regardless who logs in). We do not use roaming profiles.
RSOP shows that the policy was applied but the printer does not show up, nor does the msg box.
If I run the script on a wkstn it functions just fine.
If I put the script in the "run this program on startup" part of the machine GP it functions also but the user gets a warning with XP SP2 before the vbs runs (and they can stop it of course).
Any pointers as to what I am missing?
Marty
Network Admin
Hilliard Schools