Page 1 of 1 1
Topic Options
#16468 - 2002-01-22 02:22 PM Find printers
X Offline
Fresh Scripter

Registered: 2002-01-04
Posts: 28
Loc: Greece
Hi guys.

I have a terminal server and on it users log on.When a user logs on I want to find what printers are setup to the user's pc not on the server.I have written a script but this script finds the setup printers existing on the server.Have any idea?

Thank you.

X-The truth is out there.

Top
#16469 - 2002-01-22 03:36 PM Re: Find printers
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
X,

Do you want to find all of the printer's on the client workstation?

It has been my experience with Terminal Server, that the printer that has been mapped to LPT1 is the one that is picked up by Terminal Server. The other thing is that you Terminal Server needs to also have the drivers installed like HP LJ III. Once you have the drivers installed on TS and LPT1 mapped on the client to a network printer, it should work great.

Thanks!

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#16470 - 2002-01-22 03:45 PM Re: Find printers
X Offline
Fresh Scripter

Registered: 2002-01-04
Posts: 28
Loc: Greece
I read your answer,but I need to find all the printers on a client's pc.Also some machines don't print on its own LPT but in others client's pc.But the other client's printer must be the default printer.
So I need to find all the setup printers on the client,compare with the server's database setup printer,find the default printer on each client and map this printer on the client.

Any idea?

Top
#16471 - 2002-01-22 04:04 PM Re: Find printers
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
Ok, my experience is WTS + Metaframe + Citrix ICA client, so YMMV but...

1) You must enable autoprinter creation in the client, the user manager properties and the ICA connection. You must also enable the default printer settings.

2) You must have the printer driver with the exact same spelling installed on the server as on the client. If you can't, you must edit the WTSUPRN file on the WTS server and map the driver name manually.

If you get that all right then the default printer on the users PC will become the default printer in their WTS enviroment when they log on. At least that's the theory.

Personally that's not the way I do it, as it is flaky (prone to error) and doesn't help users on a thin client.

I have a print queue defined for all networked printers on a centralised print server, and each user has a small config file in their home directory which lists all the printers to connect. The first printer in the list becomes their default. The only people who auto-create printers are those on dial-ups or who have printers without network connectivity.

To answer your original question, I don't think that there is a way of getting a list of printers on the client PC, other than enumerating printer shares or reading the client PCs registry.

There is a SDK available from Citrix which exposes some of the Metaframe APIs, but it's pretty scary stuff.

Top
#16472 - 2002-01-24 12:38 AM Re: Find printers
X Offline
Fresh Scripter

Registered: 2002-01-04
Posts: 28
Loc: Greece
Hi,
I read your answer but it didn't work on terminal server system.Any other idea?I am trying to adopt the HKEY_CURRENT_USER but I cannot do it work.

x-The truth is out there.

Top
#16473 - 2002-01-23 03:49 PM Re: Find printers
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
X,

Why do you or would you need all printers from a Workstation when you login to Terminal Server? Are you using published applications or are you giving your users their own desktop?

For example, I talked with our Citrix Admin about this and he has advised strongly against using Adobe Acrobat (the PDF Printer or Distiller) as it is resource intensive on the Terminal server.

Can you post a snip of your code to show us what you mean?

Anyway, I am going to forward this along to him and see what his thoughts are on this.

Thanks!

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#16474 - 2002-01-23 05:28 PM Re: Find printers
X Offline
Fresh Scripter

Registered: 2002-01-04
Posts: 28
Loc: Greece
Hi kdyer,
The code I have written is the following.

$INDEX=0
$Loop = "Y"
While $Loop = "Y"
$ValueKey = ENUMKEY("HKEY_CURRENT_USER\System\CurrentControlSet\Control\Print\Printers", $Index)
If @ERROR = 0
If $Index = 0
? "Installed printers : " + $ValueKey + " -> " + ReadValue("HKEY_CURRENT_USER\System\CurrentControlSet\Control\Print\Printers\" + $ValueKey, "Port")
Else
? " : " + $ValueKey + " -> " + ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Printers\" + $ValueKey, "Port")
Endif
$Index = $Index + 1
Else
$Loop = "N"
Endif
LOOP

If you run this script you will find all the setup printers on the machine you run the script.For example I run the script on my machine it will find my installed pritners.

We run an ERP-Orama project on terminal server.On this server users logs in.When a user logs in,in order to print through ERP-ORama I must fulfil the following requiremnts:
1)I must have installed a printer on my machine locally or remotely.
2)The same printers must be installed on Termninal server.

This I want to do is when a users logs in the script search his machine to find the default printer,search the server to see if the drivers of the default printer are installed and finally set this mount this printer to the client.If the default printer of the client is not installed on ths server then the clinet cann't print.

I don't know if this was enlightening.

Thank you

x - The truth is out there.

Top
#16475 - 2002-01-23 05:39 PM Re: Find printers
mopyfisch Offline
Fresh Scripter

Registered: 2002-01-23
Posts: 19
I do not understand, why you're looking for the installed printers. Just map a printer, when the user loggs on.
Top
#16476 - 2002-01-24 10:29 AM Re: Find printers
X Offline
Fresh Scripter

Registered: 2002-01-04
Posts: 28
Loc: Greece
Mopyfisch.
If you have read my post carefully you would have understood what I want.I Want to find the printes on a clients machine because I don't know if a printer is installed on the machine.If a printer is installed on the client's machine the same printer must be installed on the Terminal server in order the clinet can print through the Orama - ERP which runs on the terminal server.That's why I need to find the client's printers.

Also I want to know how to map Network printers(printers with ethernet cards on them)
X- The truth is out there.

[ 24 January 2002: Message edited by: X ]

Top
#16477 - 2002-01-24 02:15 PM Re: Find printers
mopyfisch Offline
Fresh Scripter

Registered: 2002-01-23
Posts: 19
Hmm, why don't you try the printer redirection support from the terminalservice?
Top
#16478 - 2002-01-24 02:30 PM Re: Find printers
X Offline
Fresh Scripter

Registered: 2002-01-04
Posts: 28
Loc: Greece
Because in some way the terminal server lunches wrong printer sessions.It may lunch the correct but it lunches an other session also wrong and sometimes the client which is in Athens prints in Thessaloniki.


X - The truth is out there.

Top
#16479 - 2002-01-24 02:50 PM Re: Find printers
mopyfisch Offline
Fresh Scripter

Registered: 2002-01-23
Posts: 19
mmh, not good.
there is another feature from the terminalserver for the commandline

if you type qwinsta, you can see, the open sessions, the one witch ">" is your one, but i did not find out how to find out the clientname.

is very difficult your problem.

Top
#16480 - 2002-01-31 09:26 AM Re: Find printers
X Offline
Fresh Scripter

Registered: 2002-01-04
Posts: 28
Loc: Greece
Hi again,

After my 4 day absence I am back.I am searching in my registry to find the client's settings but I cannot find nothing.That I discover is ale the installed printers on the Terminal server and all the sessions.Is there a way to find the clinet's settings in the registry?For example if the "filio" user is logged in the terminal then a key in the registry called "filio" and under this I can find all her settings.
How can I do this?

X - The truth is out there.

Top
#16481 - 2002-01-31 05:52 PM Re: Find printers
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
X -
I think I understand what you want to do, but bear with me.

You wish to compare printers defined on client workstations with defined Terminal Server (TS) printers. If printer on client does not exist on the TS, the printer must be added to the TS installed printers.

It appears to me a two step process.

Step 1, obtain a list of TS printers to compare with the client printers. I do not believe the clients executing the KiX script will be able to pull this from the TS registry, so either this printer list will exist in your script or external INI file. Recommend INI file to ease day-to-day management. I do not have a TS server, so I can not provide much specific assistance on this component.

Step 2 - query each client via KiX for all printers installed, compare each printer found with every TS printer from step 1. If printer found, script moves on to next client printer. If no match found, printer added to TS in some manner. This manner undetermined, but likely entails alert to TS admin to manually add the printer, versus client adding via KiX script.

The client registry keys holding printer data are:
WinXP/2K/NT: HKEY_CURRENT_USER\Printers\Connections

Win9x: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Printers

Please let the board know if the above is accurate.

Bill

[ 31 January 2002: Message edited by: bleonard ]

Top
#16482 - 2002-02-01 01:07 PM Re: Find printers
X Offline
Fresh Scripter

Registered: 2002-01-04
Posts: 28
Loc: Greece
No bleonard this is not exactly what I want.What I want is that.

I wish to compare printers defined on client workstations with defined Terminal Server (TS) printers. If printer on client exists on the TS, the printer must be defined default to the client's printers,otherwise a message apperars saying no printers available.
And something else.How can I create the external ini file?I am know to Kix and I need help.

Any idea?

X - The truth is out there.

[ 01 February 2002: Message edited by: X ]

Top
#16483 - 2002-02-01 03:52 PM Re: Find printers
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
X,

I found the vendor's site at - http://www.qnr.com.gr/en/products/oramaerp.htm

Let's break this down into "bite-sized" chunks.

(1) Is ERP-Orama run as a published app or do you give your users a desktop to run this?
(2) Is ERP-Orama a 16-bit or 32-bit application? In other words if you were to run it from your desktop, do you have to print to LPT1 (or local printer)?
(3) Why do you have to run it either in Terminal Server or as a stand-alone app?
(4) How many printers are in your organization? If it is anything like ours, you will have hundreds..
(5) So, if you login to Terminal Server \\TS1 do you want each and every printer that is attached in your organization to be listed on this server? So, if I am on the WAN and I were to login from Athens do I really need or care to see or "compare" what is in Rome?
(6) If you login to a workstation in Athens and you have one network printer, why or how would you "compare" what is installed on the Terminal Server? It has been my experience that the Terminal Server creates the printers dynamically and you will see the printers from each and every office that are on the network. The only criteria needed is that the Terminal Server has the Printer Drivers for the printer installed for compatibility.

It really seems that we are going round and round chasing our tails here and not answering or addressing your underlying issue. Have you considered posing this question to the "Thin List?" Our Citrix Admin has a subscription to it and it is very active. I have forwarded this thread to him before and will ask him to look at it again to see if anything pops out for him.

Thanks for you time and patience with us!

- Kent

[ 01 February 2002: Message edited by: kdyer ]

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#16484 - 2002-02-22 02:36 PM Re: Find printers
X Offline
Fresh Scripter

Registered: 2002-01-04
Posts: 28
Loc: Greece
Kdyer , after my long abdence I am back again.I was out for training no able to have access to my data in the company.same answers are list below.
1) Is ERP-Orama run as a published app or do you give your users a
desktop to run this?


The users do not access the desktop, but ORAMA ERP is not a published
application, we run just win2000 no CITRIX

(2) Is ERP-Orama a 16-bit or 32-bit application? (3) Why do you have to
run it either in Terminal Server or as a stand-alone app?


ORAMA ERP is a 32-bit application, the client is 250 Mbytes and we
prefer not to have to update the client, so we run out of Terminal
server

(4) How many printers are in your organization?


Approximately 25 printers


These are the answers.Any new idea?

Thank you.

x - the truth is out there.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 144 anonymous users online.
Newest Members
Jodey, Hiker, GTRoberts, KatieQuinn, Brennnnn
17684 Registered Users

Generated in 0.039 seconds in which 0.012 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org