Get Windows User Display Name

You should use UserPrincipal.DisplayName:

System.DirectoryServices.AccountManagement.UserPrincipal.Current.DisplayName

To do so, you’ll need to and add a reference to System.DirectoryServices.AccountManagement.dll from your project.

Note: Doesn’t work when machine is unplugged from the network or domain server is not reachable.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)