[Active Directory] Active Directory user object's direct reports are not being displayed

[Active Directory] Active Directory user object's direct reports are not being displayed

  
Forge Component
(6)
Published on 12 Jul by Renato Pauleta
6 votes
Published on 12 Jul by Renato Pauleta

Hi everyone,


My company would like to implement Active Directory into the application we're developing so I had a look on Forge and found an Active Directory application published by Renato Pauleta. I've got it connected to my company's AD domain and can successfully see users and groups, however, not all information is displayed on the screen. A crucial information that is missing when I search a user is their direct reports. I have checked the browser console log and the expression used to output the direct reports info to the screen did not have any errors. I have double checked and can confirm that the users I performed a search with does have direct reports under their name.

Could someone please assist. Thanks in advance.


Cheers,

Dalen

Hi Dalen,

It's something that I forgot to include in the extension. I'll have to check how it's done, because if you have just one direct report then it's just adding one line of code, but you can have multiple so in order to make this right we'll need to have a list of direct reports.

I'll try to upload a new version as soon as possible. I have a new version almost ready to come out which will allow more control over the domains and containers and I'll try to include the direct reports in it (this will be on version 10). If you need it to be on version 9 I can make the fix in the current uploaded version, but it will not have all the new features; and I'd rather not change version 9 anymore (it's just not as fun :-) ).

I'll get back to you soon.

Cheers,

Renato


UPDATE

I'm going to include the direct reports in the user structure, but they'll come in the form of a list of distinguished names (DN), so you'll have to use the "AD_UserGetDetails" (the username can be the DN) to get the user info. The reason I will not include the full details here is performance.

There's another way you can get the list of direct reports without having to wait for the new version. Just use the "AD_UsersSearch" with ADSearchType = Manager and use the manager DN in the Search input, this will get you the list of direct reports.

Hi Renato,


Thanks for your quick response. I'll wait for the new version in anticipation! :) 

In the meantime I'll try modify the current version with your suggestion and see if I can get it to display the direct reports.


Cheers,

Dalen

UPDATE


I tried your suggestion and it didn't work. I tried searching a General Manager's DN in the AD_Search textbox and changed the AD_SearchById to Manager but no results were returned. Is it because the ID is set to 'Manager' and needs to be changed to 'General Manager' or did I not follow your steps correctly? Please advise.


Thanks,

Dalen

Hi Dalen,

It should have worked. The search type is just to tell the extension what to search for. The "General Manager" is just a manager like all others in your AD right? Meaning, it exists in the manager field of other people?

Example:

Carla here is my manager, if I use the search with her DN, something like "CN=Carla Almeida,OU=OutsystemsOU,DC=local" and use the search type "manager", I'm basically searching for all users in AD that have the manager field with Carla's DN. Does the DN you've tried as any type of special characters? Just realized I need to escape my filters https://msdn.microsoft.com/en-us/library/aa746475.aspx (bottom of the page).

In the mean time there's a new version which gives back the direct reports, but they come in the form of a list of DN's, not sure if it will work, but let me know.


Hi Renato,

Sorry for the confusion. I did a search with just the manager's common name so that's why it didn't work but after trying again with the whole DN "CN=James ..." it worked. :)

So right now when I search a user, their manager (or direct reports) is shown by DN. I was wondering if it is possible to display just the Common Name? Is there an easy way of doing this such as retrieving just the CN part or would I need to filter it with regex? If it's filtering, could please provide an example on how to do so?


Thanks,

Dalen

Hi Dalen,

Great to hear that it worked. :)

As for showing just the common name the easiest way is probably regex (you'd have to find what's the correct one). One other way is to use String Split from the text extension. Split it by "," and the first one is the "CN=Common Name", then just remove the "CN=" part using replace and you have the common name.

Cheers.