Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find a user's Active Directory display name in a C# web application?

Tags:

People also ask

How do I get the Active Directory display name?

In Active Directory (AD), the display names of AD users can be obtained using the Get-ADUser cmdlet . However, using the Get-ADUser cmdlet to retrieve the display name of a specific set of users can prove to be a difficult task because: Minute syntax errors or typographical errors can lead to execution failures.

What is Active Directory user name?

In Active Directory, the User Principal Name (UPN) attribute is a user identifier for logging in, separate from a Windows domain login. For more, see Microsoft's User Naming Attributes . The format of the UPN attribute at IU is [email protected] .


I'm writing a web application which uses windows authentication and I can happily get the user's login name using something like:

 string login = User.Identity.Name.ToString(); 

But I don't need their login name I want their DisplayName. I've been banging my head for a couple hours now...

Can I access my organisation's AD via a web application?