How to get the Fullname of the Windows User?


#1

Hi All,

Let assume the system user login id is “ui2” and the full name of the User is “UiPath Pro”.

When I use GetEnvironmentVariable or Environment(“Username”) I am getting “ui2” but I need result as “UiPath Pro”.

How can i get this?


#2

Not sure if it works,but just googled

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.


#3

Hi Thanks for your help. Please let me know how to add DLL (System.DirectoryServices.AccountManagement.dll) into UiPath Project?


#4

This link will guide you how to add custom or externa DLL into uipath.

Regards…!!
Aksh


#5

displaynameWindows.xaml (5.8 KB)