How to make a search from the ActiveDirectory Resource

Hello, I'm trying to implement a workflow (java class invoked) that searches and retrieve the DistinguishedName of a user, using the ActiveDirectory Resource created in Identity Manager System.

What I don't know is how to send commands to the Active Directory Adapter to do a search of a user and retrieve data. Where can I find this documentation?

Have any of you have done this before?

Thanks in advance

[432 byte] By [dieraven2003] at [2007-11-26 12:02:22]
# 1

This task is done quite often along with other AD queries that you will need as your implementation of Idm becomes more robust. However, this task is not trivial. To see documentation concerning this issue, see the document Idm workflows, forms and views. Do a search for "searchFilter" and you will see some brief examples and configuration notes. There are some other examples in other documents that may get you in the park, but AD is not one of them. Once you have constructed a search filter you will need to pass in at least some known attribute to get back the DN. So you could pass in the sAMAccountName or employee number, or something that is unique to ensure you get back the correct DN.

If this does not answer your question and you have other similar tasks related to AD, I would suggest getting someone from Sun Professional Services to help you out with this.

mfortune99 at 2007-7-7 12:26:48 > top of Java-index,Web & Directory Servers,Directory Servers...
# 2

Dude,

Here is some code you can use either in a workflow or whereever you want. Should do the trick. Modify attributes etc as you see fit.

/Anders

<invoke name='getResourceObjects' class='com.waveset.ui.FormUtil'>

<select>

<ref>context</ref>

<ref>:display.session</ref>

<invoke name='getLighthouseContext'>

<ref>WF_CONTEXT</ref>

</invoke>

</select>

<s>Account</s>

<s>AD</s>

<map>

<s>searchContext</s>

<s>ou=People,dc=customer,dc=com</s>

<s>searchScope</s>

<s>subTree</s>

<s>searchAttrsToGet</s>

<List>

<String>mail</String>

<String>distinguishedName</String>

</List>

<s>searchFilter</s>

<s>(&(objectClass=person)(mail=*))</s>

</map>

</invoke>

anders@inserve at 2007-7-7 12:26:48 > top of Java-index,Web & Directory Servers,Directory Servers...
# 3
hello I'm executing the code but the method returns an object, in the log appears as: [com.waveset.object.GenericObject@77bcd5]how can I convert or use this object? I just need a String, or do I need to do some cast?thanks
dieraven2003 at 2007-7-7 12:26:48 > top of Java-index,Web & Directory Servers,Directory Servers...
# 4
A list of objects is returned. So iterate over the list to get the objects. After you get the object, you need to get the attribute from it.ie.<get><ref>theObject</ref><s>attributeName<s></get>
ChaseDM at 2007-7-7 12:26:48 > top of Java-index,Web & Directory Servers,Directory Servers...