Get full-qualified user-domain in asp.net

M

Markus Strobl

Hi!

I'm currently developing an ASP.NET application which uses Windows
Integrated Security to display different data depending on the Windows User
how requests the page.

So far so good but i also need to get the full qualified name of the user
domain visiting the page to make my app work properly.

I'm currently reading the logged on user by a call to
Request.ServerVariables["LOGON_USER"] but this call will only give me the
short domain name (i.e. i get "myDomain\Markus" but i need
"myDomain.rbgooe.at\Markus").

Is there any way to do it using ASP.NET technology? Or will i have to use
ActiveDirectory-Queries to resolve the domain name?

Thanks a lot for any advice!

Greetings

Markus
 
M

Markus Strobl

ok i was able to solve the problem on my own using .net active directory
support :

the following call gave me just what i needed:
System.DirectoryServices.ActiveDirectory.Domain domain =
System.DirectoryServices.ActiveDirectory.Domain.GetCurrentDomain();

Description from MSDN: "... Gets the Domain object for the current user
credentials in effect for the security context under which the application
is running...."

Greetings

Markus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top