473,404 Members | 2,137 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,404 software developers and data experts.

Retrieve Domain Logon

I am trying to pull the user logon info in an application to use as a
security stamp when someone completes a function. So far, I am able to
retrieve the computer name. This is, however, not what I'm looking for.

For example, if Sally logs on to the domain as 'sallyJ', then I'd like
to be able to pull the logon 'sallyJ' when she clicks a button.

Here is the code I am using:

(Before declarations)
Imports System.Security
Imports System.Security.Principal.WindowsIdentity

IN a sub btnName_Click():
Dim user As String
user = GetCurrent.Name.ToString

So far, if 'sallyJ' logs onto the network and is using a PC named
'sally_PC', then I get 'sally_PC' when I am really wanting 'sallyJ'.

I appreciate any help or direction you can give me.

Dec 5 '05 #1
5 2394
WindowsIdentity.GetCurrent.Name should work... on my machine it gives me the
logon name in the form of 'domain\username'

<tj*****@phenom-biz.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I am trying to pull the user logon info in an application to use as a
security stamp when someone completes a function. So far, I am able to
retrieve the computer name. This is, however, not what I'm looking for.

For example, if Sally logs on to the domain as 'sallyJ', then I'd like
to be able to pull the logon 'sallyJ' when she clicks a button.

Here is the code I am using:

(Before declarations)
Imports System.Security
Imports System.Security.Principal.WindowsIdentity

IN a sub btnName_Click():
Dim user As String
user = GetCurrent.Name.ToString

So far, if 'sallyJ' logs onto the network and is using a PC named
'sally_PC', then I get 'sally_PC' when I am really wanting 'sallyJ'.

I appreciate any help or direction you can give me.

Dec 5 '05 #2
Maybe this has to do with the fact that it is a web form. I don't know
the implications of webform vs. windows form, but I am only able to get
my computer name in this manner 'computername\ASPNET'.

If anyone here can help, please tell me.
If not, I'll pose this question to a specific ASP.NET group.
Thanks!

Dec 6 '05 #3
If you're doing this in a web form, you will get the ASPNET user if
anonymous access is on.

To be able to retrieve the user's current network name, you have to enable
windows authentication and impersonation (see the ASP.NET online docs for
more details - or indeed a asp.net newsgroup :-) ) .

Hope this helps...

<tj*****@phenom-biz.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Maybe this has to do with the fact that it is a web form. I don't know
the implications of webform vs. windows form, but I am only able to get
my computer name in this manner 'computername\ASPNET'.

If anyone here can help, please tell me.
If not, I'll pose this question to a specific ASP.NET group.
Thanks!

Dec 6 '05 #4
Yes, to an extent it has. I have read quite a bit today in terms of
authentication and impersonation. I have set impersonation to 'true'
and authentication to 'windows'. The difference I saw was in getting
'computername\IUSER_computername'. I feel I am a step closer and am
wondering if a configuration in IIS could be causing the difference I
see. I also noted that authorization is set to allow all users. I don't
believe this is related or causing my issues.
Thanks.

Dec 7 '05 #5
My problem was due to configuration settings in IIS. I did a little
research and found that security was set to allow anonymous users. I
changed this to require Integrated Domain Authentication and it worked
like a charm.
Thanks for your help.

Dec 7 '05 #6

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

Similar topics

7
by: Johan den Boer | last post by:
Hi, I am new to php. Is it possible to find out the windows user name in php ? Logon in windows domain with 'user1'. I want to get the username in php in my example : user1. How do you that...
4
by: \Rob\ | last post by:
On a domain controller, the ASPNET (v1.1) worker process (aspnet.wp.exe) runs under the IWAM_machinename acount (IIS 5). I have expressly denied this user the logon locally right in the domain...
5
by: Bruno Mendonça | last post by:
My boss asked me to build a program to create a report with logon/logoff events for all users within our windows domain. I'm using .Net to do so and decided to have a program running on the Domain...
5
by: tjonsek | last post by:
am trying to pull the user logon info in an application to use as a security stamp when someone completes a function. So far, I am able to retrieve the computer name. This is, however, not what I'm...
5
by: tjonsek | last post by:
I am trying to pull the user logon info in an asp.net application to use as a security stamp when someone completes a function. So far, I am able to retrieve the computer name. This is, however,...
10
by: Martin Robins | last post by:
I need to access the scheduler service on a network computer in order to manipulate it remotely from .NET; I have all of the necessary code to perform the manipulation and it works - great - but I am...
8
by: None | last post by:
Hi, If anybody knows how to get the domain name(only domain name) of the system pls let me know. Thanks and Regards, Vinothkumar B bvinoth@tvsinfotech.com
10
by: Sridhar | last post by:
HI, I am having problems setting up a website so that it will be available only inside the domain. We have three servers. One is iis server and second one is internal server and the third one is...
1
maxamis4
by: maxamis4 | last post by:
Hello folks, Here is the backgroup. I am creating an agent that can find a user in LDAP and return the last logon date. Now i am not sure if with active directory you can user the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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,...

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.