cancel
Showing results for 
Search instead for 
Did you mean: 
aaron_hall
Nintex Newbie

Query LDAP

Jump to solution

Hi All,

I am just trying to see if a users email exists in our Active Directory. I seem to be having trouble getting any results. I am sure its something I am doing wrong.

I am using (&(objectClass=user)(mail={WorkflowVariable:E-mail Address})) to get the users email address. I am unsure on what value I need to be putting into [Property to Retrieve].

Essentially after that I just want to have a decision tree. If it exists - email Initiator - else Create AD user.

Any help is much appreciated.

A

Reply
11 Replies
patrick_hosch
Nintex Newbie

Re: Query LDAP

Jump to solution
  1. Try one of the following queries:
    1. If you have the username: (&(objectClass=user)(sAMAccountName={username of the user to retrieve the email from}))
    2. If you only have the email address: (&(objectClass=user)(mail={WorkflowVariable:E-mail Address}))

      That will return all the properties of the user you are looking for.

  2. Then as the property to retrieve select "mail" and store it in a variable
  3. After the LDAP query simply check whether the variable you are storing the result in is empty or not. if it is, then the user doesn't have an email set.

View solution in original post

Reply
aaron_hall
Nintex Newbie

Re: Query LDAP

Jump to solution

That is perfect – I got it working – I will jump on the site and mark as the right answer.

Thanks mate.

A

Reply
bhutim
Nintex Newbie

Re: Query LDAP

Jump to solution

Hi Patrick,

This was very help thank you. Do you perhaps know how to get the fields that have space in them. For some reason I managed to get he results back but for the columns that has space in between I get nothing back.

Regards

Bhuti

0 Kudos
Reply
bhutim
Nintex Newbie

Re: Query LDAP

Jump to solution

Hi Patrick Hosch,

I thought I should clarify, to be exact I am looking to pull the "Work Phone" out but I always get empty string but I can get results for Title, Name etc. All the Fields that have one name without a space they get returned.

Regards

Bhuti

0 Kudos
Reply
patrick_hosch
Nintex Newbie

Re: Query LDAP

Jump to solution

Bhuti, the "Work Phone" property is a SharePoint user profile property. The property you want to get from AD is "telephoneNumber".

Here is a list of all properties in SP and their corresponding AD properties. Also note, that properties with spaces in their name in SharePoint have an internal field name that has NO spaces. The internal field name is the one being used when working with SP user profiles.

Reply
bhutim
Nintex Newbie

Re: Query LDAP

Jump to solution
Thank you, that will be very helpful indeed.


Regards


Bhuti


Reply
cblackl2000
Nintex Newbie

Re: Query LDAP

Jump to solution

Hi Patrick,

This sounds like the specific solution I need, but I can only get the proper result with Run Now (replacing the variable with the username) and no results are returned with the variable. 

  • My input variable is single line text & I've also ensured via logging@ that it does not/appears to not have extra spaces
  • I am also testing with myself as I have the data and an email address
  • I have set up my Query LDAP as you noted in 1.1 (using an input variable for the username (the sAMAccountName). 

Can you point me in the right direction?

Thank you for any information you can provide. 

0 Kudos
Reply
patrick_hosch
Nintex Newbie

Re: Query LDAP

Jump to solution

Have you tried wrapping the variable around {TextStart} and {TextEnd} to indicate a block of text that should not be parsed further?

Additionally, although you have made sure there is no spaces at the beginning/end - you could do this via RegEx, just to be 100% sure. A pointer to an approach can be found here

Let me know if that helped

Reply
rigonzalez
Nintex Newbie

Re: Query LDAP

Jump to solution

Hi Patrick,

Would this work if I don't have the username or email address of the person I'm trying to find in AD, but I have a string var with the First Name + Last Name value? i.e.("Ricardo Gonzalez"). 

I have a document library in SharePoint with a Single Line of Text field called "Owner"; what I'm trying to do is a create a new field named "Document Owner" of type Person and use Nintex to copy the string from Owner and then paste in Document Owner as person value. I need to use a workflow because of the large amount of items in my library. Any advice on how to achieve this?

thanks!

Ricardo

0 Kudos
Reply