[Active Directory] AD_UsersGet not returning all users from AD

[Active Directory] AD_UsersGet not returning all users from AD

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

Hi,

I am currently trying to load all AD users into an entity table that I created. What I have noticed is the AD_UsersGet function is only returning 1000 AD user records. I found this out by displaying all records from my database table and it only returned 1000 rows.

I also confirmed this by performing a search query with the 1000 records and couldn't my own AD user record but when I searched myself using AD_UserGetDetails I can see all my information.

Is there any way I can retrieve all users from AD? I don't want it to be limited to 1000 rows only. 


Cheers,

Dalen

Hi Dalen,

The component doesn't have a max record limitation. Are you able to the debug ActiveDirectoryCore and check how many records does it return? Are you using a timer to load the users? Can you send me a sample of your code?

Cheers.

Renato Pauleta wrote:

Hi Dalen,

The component doesn't have a max record limitation. Are you able to the debug ActiveDirectoryCore and check how many records does it return? Are you using a timer to load the users? Can you send me a sample of your code?

Cheers.

I have checked how many records returned by the AD_UsersGet action by assigning AD_UsersGet.ADUsers.length to a variable (AmountOfUsers) and used it to display to the screen. 


This action happens on page preparation but I have also tried it with a button (binding the action to it) but same issue persists.

The entity table is called ADUsers2 and I have a local variable with a data type of ADUsers2 (entity record). For each row returned from AD_UsersGet, I am assigning the GUID, DisplayName, EmailAddress, and SamAccountName from ADUsers list to the local variable before passing it to CreateOrUpdateADUsers2.

Initially, I thought it was my application so I tried loading all the users to the entity table by calling the action in the preparation action for ADConfigurations Homepage. Again, not all users are fully loaded, however I checked the database and can see there are 53 more records now (1053). Could there be some kind of page or CreateOrUpdateADUsers2 action timeout happening? Please advise.


Cheers,

Dalen

I also tried setting the maximum iterations amount for the "For Each" to a very high number (over 9000) but that didn't help.

Solution

Thank you so very much for this! After a bit of search, I've realized that the AD search for objects was limited to the server default of 1000.

I've changed the code so that now you'll get all results, just install the latest version and let me know how it goes.

Solution

Thanks for your help, Renato. I am now able to retrieve all the users and store it in the database. :)