Check Email Address in Active Directory

Hi Team,
I want to check email address of the person in active directory using NTID .
Can anyone suggest how it can done.

Hi @som17,

Try using Active Directory Package
UiPath.ActiveDirectoryDomainServices.Activities

I tried using these activities,but it got the

below error

Please share Properties of User Status activity

can u suggest something?

All the things you are doing inside a Active Directory Scope right.

Can you please user another user and before use please verify your user account name

2 Likes

Hi @som17 ,

Can you tell me if your problem was resolved by testing with another user?
Thank you in advance for your response.

Best regards,
Nourchene

Hi @nourchene.ben-elouehma ,

The active directory is to be used under active directory scope :slight_smile:

It all mattes with the unique distinguished value under Active Directory scope… that will help a lot in these cases…

Hope this clarifies :slight_smile:

1 Like

Thank you so much @Shubham_Varshney for your reply.
Have a nice day :slight_smile:

1 Like

Wish you the same :grin:

1 Like

@Shubham_Varshney I can see that you managed to get the email id of an AD user. I have a question if you could help me. I am running UIPath on my work machine. Below is what my process looks like where I am just running a simple find DN for a user.

I have provided the AD server name and authorised username and password. When running it, no error comes up and the sequence finishes. Am I supposed to run it on a Domain control or may be I am missing something?

@Shubham_Varshney @manju.choudhari24 @som17 : Is it possible to get email id (parameter ‘mail’) using CN = ‘Full Name’ of employee.

I’ve tried using 'Get Object by Filter activity (passed different parameters ‘EmailAddress’ or ‘mail’) but still getting {}.image

I’m not sure what else is in your workflow, but if the Get activity succeeds, I wouldn’t expect it to do anything else for you… If you want to test whether it worked as expected you could put a write line and print the output var to check.

@Jeroen : I’m not having sAMAccountName value as input. That’s the reason I can’t use this activity directly.
I am having Full name value (CN) and tried with Get Objects by Filter activity to extract “mail” or “sAMAccountName” but getting {}.

@lukas.macas : Any thoughts on this?

Hi @Sonalk,
my reply was to @manju.choudhari24, but maybe there is something you could try (disclaimer, I have no experience in Active Directory):
In your screenshot I see you try to get an object, by querying "mail" = in_ManagerName. To me that looks like you’re searching for a name in an e-mail field.

Looking at the activities, this is what I would expect to be needed:
“Get Objects By Filter” will return a list of Distinguished Names of objects based on a search.
image

“Get Object Properties” will return an objects properties if you input a Distuinguished Name.
image

If you search (Get Objects By Filter) for Full Name (or whatever that attribute is called) = in_ManagerName, you will get a list of Distinguished Names of objects matching your search. If you then loop through that list of strings and input them into the “Get Object Properties”, you should get a dictionary of properties for each object you found. That should include the e-mail property you’re looking for.
Once you’ve found it, you could choose to specify it in “SinglePropertyValue” so you don’t have to get all the properties you don’t need.

Why you filter by mail when you have name as input? You need to filter by name or similar attribute.

http://www.kouti.com/tables/userattributes.htm

Thanks @Jeroen @lukas.macas : I’ve got expected email id by using below activities.

2 Likes