ActiveDirectory_GetAccountDetails False Flag

  
I am looking for more information regarding how ActiveDirectory_GetAccountDetails works. Not at the high level (you pass it a <domain>\<user> and it returns the information) but exactly what is getting queried when the IsActive flag is set. 

I have 32 users configured in the Users eSpace with AD credentials. Every night, when the SynchronizeDomainUsers timer/job runs, five of my users are set to inactive even though they are normal active user accounts in our domain.

I cloned the Users eSpace and copied the logic into a sandbox where I could debug, and it is the ActiveDirectory_GetAccountDetails function that is returning the false flag. So far I have been unable to identify any setting on these accounts that would identify them as "inactive" ... Is this a bug? Has anyone else run into this issue?
You can open the Authentication extension and check the code for yourself.

Here's the relevant code:

UserPrincipal user = UserPrincipal.FindByIdentity(context, username);
ssIsActive = (!user.Enabled.HasValue || user.Enabled.Value) && !user.IsAccountLockedOut();

So, basically if the OutSystems Platform action is saying that the user is not active, it's because the .NET class used to represent the user is saying the user is not enabled or it's locked out.
Thank you Ricardo! I was unable to open the Authentication extension due to my own problems with configuring Integration Studio. You sent me the exact information I needed to identify the AD differences.

The user.Enabled.Value for bad users is False, even though the accounts are active.

It looks like some of the AD accounts have a value in the userAccountControl attribute, and others are blank. The blank accounts are the ones that are getting automatically disabled.

Thanks again for your assistance with this, I truly appreciate it!

The AD accounts were a red herring. It appears that the issue does not occur when I set the Users eSpace to run using a domain account with elevated privileges. Just posting this in case someone else runs into the same problem. Cheers!