0 votes

I would like to send an email notification when a user, who is a group owner, account is disabled.

by (470 points)

1 Answer

0 votes
by (216k points)
selected by
Best answer

Hello,

That can be easily done with the help of a Scheduled Task. To check whether the group owner is disabled, you'll need to use a PowerShell script. To create a Scheduled Task that will send a notification if a group owner is disabled:

  1. Create a new Scheduled Task.

  2. On step 3 of the Create Scheduled Task wizard, select the Group object type.

  3. On step 4, add the Send e-mail notification action.

  4. In the Action Parameters, specify the e-mail message text, subject and recipient.

  5. Click OK.

  6. Double-click Always.

  7. To use a PowerShell script as a part of a condition, select the If PowerShell script returns true condition.

  8. Paste the following script in the Script field:

     $Context.ConditionIsMet = $False
    
     try
     {
         $ownerDN = $Context.TargetObject.Get("managedBy")
     }
     catch
     {
         return # no owner
     }
    
     $owner = $Context.BindToObjectByDN($ownerDN)
    
     if ($owner.AccountDisabled)
     {
         $Context.ConditionIsMet = $True
     }
    
  9. Enter a short description for the script and click OK.

  10. Finish creation of the Scheduled Task.

Related questions

0 votes
1 answer

I would like users to use Adaxes to add themselves or others to a group, but instead of it just working, it has to go thru an approval process and be approved by the group owner before they are added. Thanks!

asked Jun 30, 2021 by RayBilyk (230 points)
0 votes
1 answer

I've noticed the following behavior: 1. I have a group (say "group1"). The "owner" (managedby) is set to another group (distribution group) (say "group2"). 2. I ... send a message to "group2" outside of ADAxes, it works fine. Is this expected behavior? Thanks

asked Mar 1, 2012 by BradG (950 points)
0 votes
1 answer

Hello, Is there a way to send an email notification when a user is added to a group dynamically (with LDAP filter) , it's work only when i add the user manually Thank you

asked Jun 30, 2021 by GG (70 points)
0 votes
1 answer

When setting user accounts to disable we use a business rule which executes whenever a user account is modified. So for example a member from our Service Desk team will go onto ... behind for some reason, and doesn't reflect the server date/time it lives on.

asked Nov 16, 2022 by Homelander90 (330 points)
0 votes
1 answer

Is it possible, using a business rule, to reassign a user's direct reports to their manager when they get disabled? For example, User B reports up to User A. User B gets disabled and all of their direct reports automatically get assigned to User A. Thanks

asked Jul 6, 2020 by bavery (250 points)
3,347 questions
3,047 answers
7,786 comments
545,035 users