473,657 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2361
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*********@no spam.nospamwrot e in message
news:C6******** *************** ***********@mic rosoft.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*********@no spam.nospamwrot e in message
news:C6******** *************** ***********@mic rosoft.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 misunderstandin g, 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 misunderstandin g, 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 programmaticall y. 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
2079
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 simple to verify the cell the user starts in by invoking a verifying event for the underlying textbox in that cell, but what I would like to do is to change the focus to the other column in the new row if it has not been filled in. If in handling...
4
2855
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 can do this only in the .aspx form and not in a class. I would like to write a function in a common .vb class that can call the WinNT local users and find out if current user belongs to a certain group. Thanks for your help. V
1
4019
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 same way a menu does. To do this my control needs to get notified when the user tried to click off of it. The Leave and LostFocus events of the UserControl work most of the time but not always. For example, if they click on a part of the form...
2
6605
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 advance -Hari
9
20158
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 control. When I close the form I am expecting that the control ceases to be. However, if my object raises the event after the form has been closed, I find that there is still a user control object that handles it. Clearly the user control has not...
12
6559
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 have added the new user to the database and have given the user access to the database for the app. But everytime I try and login using this users ID, I always get the error: Login failed for user Christian.Gaut If I login using my userid and...
2
1564
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 control of the server, but can add components to the app - so files I can upload are OK, but I can't do installers that need to be launched on the server. It's not a e-commerce app, so no credit cards. I would like email verification w/ a code....
3
2790
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 DirectoryEntry("WinNT://us.ups.com") Dim DOMUSR As DirectoryEntry = DOM.Children.Find("USERID", "user") Dim LCLGRP As DirectoryEntry = LCL.Children.Find("LOCAL_GROUP", "group")
4
1697
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 linklabel. this leads to following exeption: Informationen über das Aufrufen von JIT-Debuggen
0
8384
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8302
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8820
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8499
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8601
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7314
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.