Get AD sAMAccountName from Display or Common Name

Hi there,
Is there any way to get sam account name from display or common name from an active directory. I have the display name of a user and i want to get its sam account name in uipath and i am not allowed to use powershell so any way i can do this using uipath activities?

Hi
i hope you mean the logon name which is same as username right , not sure and sorry if i m wrong
and there is no specific activity to do that

Cheers @rameezimtiaz

yes logon name. its same as samaccountname.

so as you said you have the username then we are good right
@rameezimtiaz

@rameezimtiaz

Try this.

       Environment.Username
1 Like

Hi @rameezimtiaz

So you have ANOTHER user’s display name, want the AD username, and can’t use Powershell.

You might be able to use LDAP. Check out the first solution here and pull what you need.

.net - How to get a username in Active Directory from a display name in C#? - Stack Overflow

Troy

@Palaniyappan im saying logon and samaccount name is same but i dont have it. i only have display name

@lakshman it works for windows. I want it for AD and not logged in user rather any user from the system. The input will be display name of the user

1 Like

Hi @rameezimtiaz

I am also looking for a solution to the same problem. Did you find any solution for this.

1 Like

Hi @ppr

To use these activities we need SAM Name. But the primary requirement here is how to get the SAM Name using the display name. Thanks

would check if following activity can help:

1 Like

It did worked @ppr . Thank you so much

@Lokesh.Bysani could you please help me with how you retrieved the SAMAccountName from the Common name? What all properties/settings do we need to configure?

Regards,
Arun