[Active Directory] Getting manager ID instead of name and getting domain
active-directory
Web icon
Forge component by Renato Pauleta
Application Type
Reactive
Service Studio Version
11.8.11 (Build 31185)

I am working on an application that configured using the LDAP authentication and it is using the Active Directory Component for getting the user data. In our case, we need to fetch the details of the direct user's manager, I am using AD_GetUserDetails for getting the manager name of the user, and then I am using the same function to get manager details by his name. I want to know is there any filed that returns the manager's id instead of his name because I cannot depend on the name to get details later, if not? then can it be added?

My other question is, I am using the SamAccountName filed for getting the username, is that right? is there any field that returns me the value with the domain name?

Thanks in advance,

Solution

Kawthar,

There's a new version "Under Development" 2.0.13 that includes what you've asked for and few other things.

Be sure to check the change log because there's an additional configuration required for this new version to work.

This version will be in "under development" while I make a few more tests on my end.

Hi,

When you get details from the user, the manager field is the DN (distinguished name). I don't have an easy way of filtering by DN. I though it would work just by using the DN directly as the username, but I was testing and it doesn't seem to be working.

I'm building a new version that improves performance on searching and getting user details, but it's going to take a while before I launch it, maybe by the end of this month. In this new version I'm going to include the DN search and get details.

In the mean time, can you try calling the AD_GetUserDetails with the DN in the username parameter and see if that works?


Cheers.

Thanks for your response Renato. 

I tried calling the AD_GetUserDetails by the DN but it didn't work. It would be great if this solved.

My other point is regarding the Username (Login Username), in which field of AD_GetUserDetails I could find it? is it the SamAccountName? can I get it with the domain name as well?

Thanks again. 

Hi Kawthar,

The new version will work with the username and the DN.

The username is the SamAccountName. 

Regarding the username with the domain, it should be the UserPrincipalName.

Cheers.

Solution

Kawthar,

There's a new version "Under Development" 2.0.13 that includes what you've asked for and few other things.

Be sure to check the change log because there's an additional configuration required for this new version to work.

This version will be in "under development" while I make a few more tests on my end.

Dear @Renato Pauleta 

Thanks for your continual help and availability. I am wondering if I can use the
Active Directory forge component Version 3.0.0. it seems it has great added features but it is marked as  Discontinued as "not stable" so I just want to confirm if I can use it.

Hi @Kawthar Ebrahim ,

You can use it, but I would suggest changing to the new component https://www.outsystems.com/forge/Component_Overview.aspx?ProjectId=11128.

I won't support this one anymore.

Cheers.

Thanks, @Renato Pauleta for the update. In the case I will move to the newer library. as I am working on a project that heavily uses AD. but I don't have any defined token information, should I use https://www.outsystems.com/forge/Component_Overview.aspx?ProjectId=11126

I liked some methods that are in the simplified one such as the import to the Users table,, but I am not sure about the concept of the token

You can definitely use just the library in such scenario. The token is just a way of simplifying access, but not mandatory. You can still look at the wrapper and the backoffice for implementation examples.

Thank you very much @Renato Pauleta, and apologize for the many questions. I have a question which is within the same context of this forum discussion. In my case I need to use the GetADUser method flexibly, by sending the username or the DN. I noticed once using the username in the input I got an exception that "incorrect dn syntax" so the get method in the new library is not working with the username? sometimes when the user first login I only have his username I don't have other details. 

I have removed that flexibility, mostly because of performance speed, the user details get is a lot faster if you use the DN directly, but you can still use the User_Search (AD_SearchUser), with the username search option.

In the previous component the User_Get (GetADUser) used the search under the hood so essentially it's the same. 

Dear @Renato Pauleta, this is noted with thanks. 

for using the AD_SearchUser what should I specify in the ADSearchByID ? can I just directly put the username in the search attribute? it seems not, because I tried that and I got ([OUTSYSTEMSDEV].dbo.[OSUSR_6GU_ADSEARCHUSER] with key 0 was not found. )

You should use the value "3" in the SearchBy parameter. The username goes in the Search parameter, yes.

You can check the available options in the SearchBy parameter descritpion.

Thanks @Renato Pauleta, I was using the ActiveDirectoy_BL and I think the descriptions are not available there.

You're right. I'll need to update that. Thanks!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.