0 votes

Mainly because we are heavy ActiveSync users, we have a lot of issues with AD Account lockouts. I'd like to have an automated way to detect account lockouts, and take an action (send an email, etc.) based on that condition.

Now, I have a powershell script that I use to check the condition of this, but I can't run the scheduled task in adaxes with enough frequency for it to fire appropriately.

Do you have a way to check for this condition?

by (470 points)
0

Hello,

Please, clarify: do you want to run your script more often than once an our or the issue is that your script does not detect locked account correctly?

0

The script that I have does correctly detect the locked-out accounts. The problem now is that I cannot run the event say, ever 30 minutes.

But, addtionally, if there is already a variable or Adaxes condition for locked status, please avise me so that I can implement this.

1 Answer

0 votes
by (216k points)

Hello,

It is impossible to run a Scheduled Task more often than once an hour. This feature is in our TODO list. Most probably, it will be implemented in Adaxes version 2013.1 that is planned for late January.

As for checking if an account is locked, there is no built-in condition to check if an account is locked, but you can use the If PowerShell script returns true condition for this purpose.

To add such a condition to your Scheduled Task:

  1. Right-click the set of actions and conditions of your Scheduled Task.

  2. Click Add Condition....

  3. Add the If PowerShell script returns true condition and paste the following script:

     $Context.ConditionIsMet = $Context.TargetObject.IsAccountLocked

The script uses the IsAccountLocked property of the user object. As an option, you can use it in your own script, for example:

$isAccountLocked = $Context.TargetObject.IsAccountLocked
if ($isAccountLocked)
{
  # TODO: add some code here.
}
0

Thank you for the response. That is, in effect, what I'm using. So, the limitation is that this can only "fire" on demand when the script is run manually or a maximum of once per day.

0

Joe,

The minimum time interval for a Scheduled Task is once an hour.

0

Starting from Adaxes 2013.1, Schedules Tasks can be set up to run every N minutes.

Also, now you don't need a script to checked whether an account is locked out. Use the If account is locked out / not locked out condition.

0

Perfect! I've already changed the task.

0

How would I check every single user in my AD?

Would I just created a for-each loop...? Would anyone mind posting code that does this?

0

Hello Michael,

The posts in this topic suggest that you create a Scheduled Task. On the final step of the Create Scheduled Task wizard, you are supposed to specify an Activity Scope for the task. A Scheduled Task Activity Scope defines the objects for which the task will be run. If you include All objects in the Activity Scope of a Scheduled Task created per the above instructions, this will mean that the task will run for each user account in your Active Directory. In other words, it will check each user.

Related questions

0 votes
1 answer

When Adaxes runs the command "Deactivate Microsoft 365 account of the user: set Sign-In status to 'Blocked', revoke all licenses" also revoke the sessions in Azure? For reference, it is the "Revoke sessions" button in the Azure portal:

asked 1 day ago by jmatthews (190 points)
0 votes
1 answer

We have some users who work offsite and rarely authenticate to our local domain controllers but they frequently log into our M365/Entra environment. Will the adm-InactivityDuration ... to check if they are inactive in both local AD and Entra before proceeding?

asked Nov 4 by smcfarland (20 points)
0 votes
1 answer

I want to add a custom column in a report that displays members of a group that shows the age of the user account in days. Is that possible?

asked Oct 23 by msheppard (470 points)
0 votes
1 answer

I am attempting to block changing of SAM Account Name through a business rule. When attempting to do a rename in the portal, changing the SAM Account Name is offered at the same time, and despite not changing it the business rule is triggered. Thoughts?

asked Aug 21 by Daniel (160 points)
0 votes
1 answer

Hi Team, Is there a way i can give the helpdesk an option to see why a users account has been locked?

asked Aug 21 by CJJaHelia (20 points)
3,548 questions
3,239 answers
8,232 comments
547,814 users