473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

User verification in windows forms

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
--
John Austin
Jun 11 '07 #1
9 2347
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.
"John Austin" <Jo*********@nospam.nospamwrote in message
news:C6**********************************@microsof t.com...
>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
--
John Austin

Jun 11 '07 #2
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,

--
John Austin
"AMDRIT" wrote:
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.
"John Austin" <Jo*********@nospam.nospamwrote in message
news:C6**********************************@microsof t.com...
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
--
John Austin


Jun 11 '07 #3
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...&Product=winxp

'How to copy data from a corrupted user profile to a new profile'
http://support.microsoft.com/default...&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/subscripti...ult.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/subscripti...t/default.aspx.
==================================================

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

Jun 12 '07 #4
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,
--
John Austin
"Linda Liu [MSFT]" wrote:
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...&Product=winxp

'How to copy data from a corrupted user profile to a new profile'
http://support.microsoft.com/default...&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/subscripti...ult.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/subscripti...t/default.aspx.
==================================================

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

Jun 12 '07 #5
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.

Jun 13 '07 #6
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,
--
John Austin
"Linda Liu [MSFT]" wrote:
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.

Jun 14 '07 #7
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

Jun 20 '07 #8
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).
--
John Austin
"Linda Liu [MSFT]" wrote:
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

Jun 23 '07 #9
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

Jun 29 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Jack Kaufmann | last post by:
I am trying to verify a datagrid in which there must be an entry in both columns of any new row, and those values must be greater than the corresponding values in the previous row. It is pretty...
4
by: Victor | last post by:
Hi all I greatly appreciate your time and help if possible. I'm currently using User.IsInRole("Group_name") to find out if the logged in user belongs to a certain NT User Group. For some reason I...
1
by: Rhy Mednick | last post by:
I'm creating a custom control (inherited from UserControl) that is displayed by other controls on the form. I would like for the control to disappear when the user clicks outside my control the...
2
by: Technical Group | last post by:
Friends, Can anybody help me out by sending a piece of C# code showing how to add an active directory user to a particular user group? If the group does not exist, then create it. Thanks in...
9
by: Charles Law | last post by:
I have a form on which user controls are placed at runtime. When a control is added to the form a handler is added for an event that a high-level object raises, which must be handled by the new...
12
by: Michael | last post by:
Please Help me. I've got a .Net 2003 program that attaches to a SQL Server machine and I'm getting the above error when a user tries to log in. The SQL server is setup to use Windows Auth. and I...
2
by: coffngrl | last post by:
I am on a super tight deadline. I am searching for any shareware asp.net components/code snippets that I can use to add user accounts, login, role-based security to a asp.net app. I am not in...
3
by: Terry Olsen | last post by:
I'm trying to add a domain user to a local group using the code below: Dim LCL As New DirectoryEntry("WinNT://" + Environment.MachineName + ",computer") Dim DOM As New...
4
by: Kerem Gümrükcü | last post by:
Hi, the topic of this thread implies the question. Why does this happen. What can i do against it. App runs in admin context, then ii switch to user standard user context and open a form with...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.