User verification in windows forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an app that prints entry tickets. If the printer driver is not set up
exactly to detect the black mark on the back of the ticket, the tickets do
not print correctly. Because of this, all users are logging on with the same
user name to ensure they get a correctly configured printer driver.

The application runs on a Terminal Server via the RDP client.

In order to audit the actions of users, it is necessary to identify each
user. Is there a way to authenticate a windows username and password, so that
whilst the program is running as UserX, the application knows that the
actions can be attributed to UserA?

Alternatively, can the printer settings be set in a way that uses the same
configuration for all users?

Thanks
 
Since you are employing an anonymous scheme to your top level security and
have all users log into the RDP session as one user, you will have to roll
your own security model in your application.

This would require your users to log into the RDP session anonymously and
then into the application as a unique individual.

Alternatively

You or the network administrator can define a group policy for the terminal
server (perhaps based on a group of users) that prepare the environment the
way you would like.

You can prepare a configuration file with all your environmental settings
the way you would like the printer to behave.
 
Can you recomend an easy to understand artical that explains how to set the
group so that they all get the same printer settings for 2 particular
printers?

Thanks,
 
Hi John,

Based on my understanding, your question is how to set up the printer
settings on a machine so that all users have the same settings. If I'm off
base, please feel free to let me know.

Your user profile is a collection of settings that make the computer look
and work the way you want it to. It contains your settings for desktop
backgrounds, screen savers, pointer preferences, printer settings, and
other features. User profiles ensure that your personal preferences are
used whenever you log on to Windows.

When multiple users log on locally to the same computer, Windows uses the
built-in default user profile as a template to assign a profile to each new
user. You can replace this built-in profile with a custom default user
profile so that each new user receives a custom version of the profile.

You could use the user profile of the Windows user that contains the
'correct' printer settings as the custom default user profile so that new
users that are created later will have the custom default user profile.
For existing user profiles, you can replace them with this user profile
directly.

For more information on how to do this, you may refer to the following
documents:

'How to create a custom default user profile'
http://support.microsoft.com/default.aspx?scid=kb;en-us;319974&Product=winxp

'How to copy data from a corrupted user profile to a new profile'
http://support.microsoft.com/default.aspx?scid=kb;en-us;811151&Product=winxp

Hope this helps.
If my suggestion is not appropriate to your practice, please feel free to
let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Thanks, Linda.

Can you help me understand where the profile needs to be set up please. The
printers are connected to a PC (one parallel, one USB). The users run 'Remote
Desktop' on that PC to connect to a Terminal Server, that runs the
application. The printers are automatically set up on the Terminal Server and
the printer names on the terminal server include the client PC and the
session number. Are the printer settings for the client PC or for the
Terminal Server? I have never used profiles so this may not make sense, but
does the profile relate to the PC or the domain?

Many thanks,
 
Hi John,

Thank you for your prompt response.

Based on my understanding, you connect two printers to the Remote Desktop
Connection client (RDC client, in short) and add the two printers on the
RDC client. Then you remote connect to the terminal server from the RDC
client. Two printers are set up automatically on the terminal server and
the printer names include the RDC client. You'd like to use these two
printers that are set up automatically to print entry tickets. If I have
any misunderstanding, please feel free tell me.

I performed some tests on this. My RDC client has a printer on it. After I
remote connect to the terminal server from the RDC client, a printer is set
up automatically and the printer name includes the RDC client name. I open
the printing preferences of the printer and find they're the default print
settings.

I tried to modify the print settings and disconnect the remote connection
and then reconnect to the terminal server. I check the printing preferences
of the automatically set up printer and find that the changes I made just
now is lost.

It seems that the system configures the print settings for the
automatically set up printer every time I remote connect to the terminal
server. I thought maybe the system configures the print settings using the
built-in default user profile on the RDC client. If so, we could replace
this built-in profile with a custom default user profile.

I have performed a test replacing the built-in profie with a custom user
profile on the RDC client, but unfortunately the result turns out that the
automatically set up printer still uses the default print settings.

I think a simple workaround of this problem is to replace the built-in
default user profile with a custom user profile on the terminal server (of
course, the custom user profile contains the correct print settings), and
use the printer on the terminal server instead of the automatically set up
printer whose name includes the RDC client name.

For the existing users on the terminal server, you may delete the user
profiles of these users for convenience. The next time they log on the
terminal server via RDC, their user profiles will be generated based on the
default user profile on the terminal server automatically so that the print
settings are what you want.

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Supporto rights.
 
Thank you Linda,

Another complication with setting the ticket printers up on the Terminal
Server is that any of the users can then print to them from applications such
as Word. Do you know of any way of hiding a printer from the Printer
Selection dialog? We need to be able to print to them only from the Ticket
Printing program!

Regards,
 
Hi John,

In my opinion, there may no way to hide a printer from the print dialog.

What's more, what you want is to hide the printer from the print dialogs of
other applications, such as Word, except the Ticket Printing program. It
adds the complication.

Could you please tell me why you don't want the users to print to the
printer from other applications?

Sincerely,
Linda Liu
Microsoft Online Community Support
 
Yes the two printers are loaded with continuous pre-printed tickets. Each
ticket has a serial number (to prevent fraud). If any other application
printed on these tickets, the operator would have to ‘void’ the ticket and
explain why it was not sold. Also if a user prints on a ticket from say Word,
they could illegally sell the ticket (some tickets are worth £500 each).
 
Hi John,

Sorry for my delayed reply.

As for your question of hiding the printer from other applications than the
Ticket Printing program, I thought that a possible workaround was to set
the the printer offline all the time. When the Ticket Printing program
starts, delete all print jobs in the printer first and then set the printer
online programmatically. When the Ticket Printing program is terminated,
set the printer back to be offline.

Note that only when a user has administrative rights on the specified
printer, can he sets the printer online/offline.

To set a printer online/offline and delete all print jobs in the printer,
we could call the Win32 API SetPrinter. There's a KB article addressing how
to use the SetPrinter function in C#. You may refer to the article via the
following link:

'How to enable and disable a printer by using the SetPrinter function in
Visual C#'
http://support.microsoft.com/kb/315720

Hope this helps.

Sincerely,
Linda Liu
Microsoft Online Community Support
 
Back
Top