Link to home
Start Free TrialLog in
Avatar of jeepr94
jeepr94Flag for United States of America

asked on

Printers in mulitiple sessions on one Terminal Server

hello, our client uses Windows 2003 for terminal servers in a 2x farm (group of 2003 terminal servers). Basically we have a script that will give a computer a set of printers based on the computer/thin client name they use to connect to that terminal server. The problem we have is a bit hard to explain but here goes:
Let say we have  ThinClient1 that is in the admin area and we have Thinclient100 that is in the HR department.

When user Bob connects to Thinclient1 from Admin he gets the proper set of printers and the right deafutl printer based off script .

Then Bob decides to go to Thinclient100 at the HR department. He will then get the proper set of printers and the correct default printer.

The problem is when bob goes back to his Thinclient1 session taht he did not log out of, he will see the printers that are meant for the HR deparmtent.

So the problem is where the user logs in last is what printers ALL his sessions on the terminal server will get.

The script appears to work just find because everytime it runs it gives the proper set of printers it just affects other sessions of the same user on that terminal server. Here is a clip of the script we use:


Set Printers = WshNetwork.EnumPrinterConnections
For Loop_Counter = 0 To Printers.Count - 1 Step 2
     WSHNetwork.RemovePrinterConnection Printers.Item(LOOP_COUNTER +1)
Next
Select Case Left(strClient,7)


Case "WHFCLBO"

            WshNetwork.AddWindowsPrinterConnection "\\192.168.1.2\ProviderHP2055"
                WshNetwork.AddWindowsPrinterConnection "\\192.168.1.2\SecureRX"
                WshNetwork.AddWindowsPrinterConnection "\\192.168.1.2\Label1"
            WshNetwork.AddWindowsPrinterConnection "\\192.168.1.2\RICOH"
            
            wshNetwork.SetDefaultPrinter "\\192.168.1.2\ProviderHP2055"


Case "WHFCLEX"

            WshNetwork.AddWindowsPrinterConnection "\\192.168.1.2\ProviderHP2055"
                WshNetwork.AddWindowsPrinterConnection "\\192.168.1.2\SecureRX"
                WshNetwork.AddWindowsPrinterConnection "\\192.168.1.2\Label1"
            WshNetwork.AddWindowsPrinterConnection "\\192.168.1.2\Exam1"
            WshNetwork.AddWindowsPrinterConnection "\\192.168.1.2\Exam2"
            WshNetwork.AddWindowsPrinterConnection "\\192.168.1.2\Exam3"
            WshNetwork.AddWindowsPrinterConnection "\\192.168.1.2\Exam4"
End Select
ASKER CERTIFIED SOLUTION
Avatar of jeepr94
jeepr94
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jeepr94

ASKER

.