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:
-
Create a new Scheduled Task.
-
On step 3 of the Create Scheduled Task wizard, select the Group object type.
-
On step 4, add the Send e-mail notification action.
-
In the Action Parameters, specify the e-mail message text, subject and recipient.
-
Click OK.
-
Double-click Always.
-
To use a PowerShell script as a part of a condition, select the If PowerShell script returns true condition.
-
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
}
-
Enter a short description for the script and click OK.
-
Finish creation of the Scheduled Task.