[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1304
  • Last Modified:

Default printer in remote session keeps changing, need to force certain one to be default.

I am using a universal print driver on our Windows Server/Terminal Server called UniPrint. This has been working very well and does not require any print drivers to be installed on the server. The UniPrint client is installed on each workstation, and directs anything printed on the Terminal Server session to the user's local default printer.
But we recently started using a specialized application that prints to a Dymo Labelwriter on each workstation. We cannot use UniPrint with this application, as it sends special control codes to the Labelwriter, and these codes do not get passed to the Labelwriter when using the UniPrint driver. So we had to turn on Windows Printer Mapping, which had been turned off when we just used UniPrint, in order for the application to direct the label jobs to the label printer.
In order for all this all to work, the UniPrint icon in Printers & Faxes on the server must be the Default Printer, so that all regular print jobs from users use UniPrint to direct the jobs to their local printer, and then the application directs the label printing to the LabelWriter. But now what is happening is that we cannot get the Default Printer choice to "Stick" with the UniPrint. It did work for a few days, but now when a user logs in to the remote server, whatever local printer they have set as the default printer ends up chosen as the default printer on the mapped version on the server.
So the question boils down to: is there any way to force a certain printer on the server to be the default printer, in spite of what the Windows printer mapping wants to do?
0
Rohidas357
Asked:
Rohidas357
2 Solutions
 
Andrew DavisManagerCommented:
Maybe if you declare what the default printer is in a VBS logon script, maybe that will work. Not sure as i havnt tried it.
0
 
JjcampNRCommented:
You can use a .VBS script at logon to set the default printer (as well as add/remove printers) as follows:

Const OverwriteExisting = True
Dim objNetwork
Dim objUser

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

'Remove Printers
  objNetwork.RemovePrinterConnection "\\Server\OldPrinter"

  ' Add Printers
  WshNetwork.AddWindowsPrinterConnection "\\Server\NewPrinter

  'Set Default Printer
  WshNetwork.SetDefaultPrinter "\\Server\Printer1"


That should do it, if you have formatting questions or technical questions let me know.
0
 
Rohidas357Author Commented:
Things have settled down on our server so that the default printer seems to be holding. I think the previous problem we were having was due to user error.

I will accept the solutions offered and close the question.

Thanks.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now