The other day I was asked to assist with implementing the scenarios below:
- Scenario 1: Alert for changes to the ‘Domain Admin’ group membership
- Scenario 2: Alert when the Audit Policy is changed (Default Domain or Domain Controller)
- Scenario 3: Alert when xx number of unsuccessful logons occur within nn hours
- Scenario 4: Account locked out x number of times in a 24 hour period
I’ve decided to blog about it as I am likely to need it again in the future and it may help someone else as well!
Scenario 1: Alert for changes to the ‘Domain Admin’ group membership
Prerequisites
- OpsMgr agent installed on domain controllers (more info...)
- Notification Channel, Subscriber & Subscription configured (more info...)
- Enable ‘Audit Account Management’ for the ‘Default Domain Controllers Policy’ (more info... and how to)
Step-by-Step
Create an ‘Alert Generating Rule’ as below:
(more info... and how to)
Note: Rules are used here instead of monitors as monitors will affect Parent Monitors while rules will not.
- Use Parameter 3 in screenshot above (more info here and here) or;
- ‘Use parameter name not specified above’ and ‘EventDescription’.
- Enable newly created rule for ‘all objects of class: Windows Domain Controller’ by using an override. (more info...)
- Create a notification subscription for the rule. (more info...)
|
Operations Console > Authoring > Rules > Create a new rule Note Create a new destination management pack if required. Next |
|
| Select > ‘Windows Domain Controller’ Note Un-tick the ‘Rule is enabled’ checkbox. Next |
|
| Select Security as the log name. Next |
|
|
Configure the event expression as depicted in the image. Next
|
We will use the following event id’s in this section: 632 – A member was added to a global group. 633 – A member was removed from a global group.
Note there are two ways to do this: Method 1 is preferred. |
| Change the severity and priority settings as required. Create |
|
|
Next steps: |
Alert example
Scenario 2: Alert when the Audit Policy is changed (Default Domain or Domain Controller)
Prerequisites
- OpsMgr agent installed on domain controllers (more info...)
- Notification Channel, Subscriber & Subscription configured (more info...)
- Enable ‘Audit Policy Change’ for ‘Default Domain Policy’ (more info... and how to)
Step-by-Step
Create an ‘Alert Generating Rule’ as below:
(more info... and how to)
|
Operations Console > Authoring > Rules > Create a new rule Note Create a new destination management pack if required. Next |
|
| Select > ‘Windows Domain Controller’ Note Un-tick the ‘Rule is enabled’ checkbox. Next |
|
| Select Security as the log name. Next |
|
|
Configure the event expression as depicted in the image.
Next |
We will use the following event id in this section: |
| Change the severity and priority settings as required. Create |
|
|
Next steps:
|
Alert example
Scenario 3: Alert when xx number of unsuccessful logons occur within nn hours
Disclaimer: This is a complex scenario and I am not sure that my proposed solution is the simplest...it works though! :-)
The following is relatively easy to do though:
· Create an alert for each Unsuccessful Logon.
· Create an alert for each Unsuccessful Logon for a specific user.
· Create one suppressed alert (i.e. repeat count is increased) for all Unsuccessful Logons.
· Create one suppressed alert per user account that attempted an unsuccessful logon. Add 1 to the ‘RepeatCount’ for each subsequent occurrence in a 24 hour period. Create a rule to auto-resolve all related active alerts. Create a rule to send hourly notifications when the ‘RepeatCount’ exceeds xx. I documented only this scenario below.
Prerequisites
- OpsMgr agent installed on domain controllers (more info...)
- Notification Channel, Subscriber & Subscription configured (more info...) – not strictly speaking necessary for the proposed solution.
- Enable ‘Audit Account Logon Events’ for ‘Default Domain Controller Policy’ (more info... and how to)
Step-By-Step
(Create one suppressed alert per user account that attempted an unsuccessful logon. Add 1 to the ‘RepeatCount’ for each subsequent occurrence in a 24 hour period. Create a rule to auto-resolve all related active alerts. Create a rule to send hourly notifications when the ‘RepeatCount’ exceeds xx.)
Create an ‘Alert Generating Rule’ as below:
(more info... and how to)
|
Operations Console > Authoring > Rules > Create a new rule
Note Create a new destination management pack if required.
Next |
|
| Select > ‘Windows Domain Controller’ Note Un-tick the ‘Rule is enabled’ checkbox. Next |
|
| Select Security as the log name. Next |
|
|
Configure the event expression as depicted in the image.
Next |
We will use the following event id in this section: 675 - Preauthentication failed. This event is generated on a Key Distribution Center (KDC) when a user types in an incorrect password. |
| Change the severity and priority settings as required. Alert Suppression |
|
| Configure the alert suppression fields as depicted in the image. Ok |
|
| Create | |
|
Next steps: Enable newly created rule for ‘all objects of class: Windows Domain Controller’ by using an override. (more info...) |
Alert example
Create a rule to resolve all unsuccessful logon alerts on a daily basis
|
Operations Console > Authoring > Rules > Create a new rule
Note Create a new destination management pack if required. Next |
|
| Select > ‘Root Management Server’ as the rule target. Note Un-tick the ‘Rule is enabled’ checkbox. Next |
|
| Define the schedule as required. | |
| Create a directory on the root management server i.e. c:\scripts > Save the following powershell script in the directory. Note Change the script as required i.e. path to OpsMgr startup.ps1 and rule name. |
# ResolveUL.ps1 # Author: Johan Vosloo # Date: 29-10-2009 # Note: The name i.e. "Custom Rule - Count Unsuccessful Logons" below must match the rule name that is used to create the surpressed alert. # Script requires Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Startup.ps1 to be in "c:\Program Files\System Center Operations Manager 2007" - Change as required. add-pssnapin "Microsoft.EnterpriseManagement.OperationsManager.Client"; Set-Location "c:\Program Files\System Center Operations Manager 2007"; .\Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Startup.ps1; get-alert | where {($_.Name -eq "Custom Rule - Count Unsuccessful Logons") -and ($_.ResolutionState -eq "0")} | resolve-alert -comment "CLOSE daily informational alerts" | out-Null; |
| Configure command line execution settings as depicted in the image. Create |
|
|
Next steps: Enable newly created rule for ‘all objects of class: Root Management Server’ by using an override. (more info...) |
Create a rule to send notification when alert ‘RepeatCount’ equal xx within nn hours
|
Operations Console > Authoring > Rules > Create a new rule
Note Create a new destination management pack if required. Next |
|
| Select > ‘Root Management Server’ as the rule target. Note Un-tick the ‘Rule is enabled’ checkbox. Next |
|
| Define the schedule as required. | |
| Create a directory on the root management server i.e. c:\scripts > Save the following powershell script in the directory. Note Change the script as required i.e. path to OpsMgr startup.ps1 and rule name. |
# NotifyULogon.ps1 |
| Configure command line execution settings as depicted in the image. Create |
|
|
Next steps: Enable newly created rule for ‘all objects of class: Root Management Server’ by using an override. (more info...) |
Scenario 4: Account locked out x number of times in a 24 hour period
Disclaimer: This is another complex scenario and I am again not sure that my proposed solution is the simplest...it works though! J
Prerequisites
- OpsMgr agent installed on domain controllers (more info...)
- Notification Channel, Subscriber & Subscription configured (more info...)
- Enable ‘Audit Account Management’ for the ‘Default Domain Controllers Policy’ (more info... and how to)
Step-By-Step
(Create one suppressed alert per locked out user account. Add 1 to the ‘RepeatCount’ for each subsequent occurrence in a 24 hour period. Create a rule to auto-resolve all related active alerts. Create a rule to send hourly notifications when the ‘RepeatCount’ exceeds xx.)
Create an ‘Alert Generating Rule’ as below:
(more info... and how to)
|
Operations Console > Authoring > Rules > Create a new rule
Note Create a new destination management pack if required. Next |
|
| Select > ‘Windows Domain Controller’ Note Un-tick the ‘Rule is enabled’ checkbox. Next |
|
| Select Security as the log name. Next |
|
|
Configure the event expression as depicted in the image.
Next |
We will use the following event id in this section: 644 - A user account was auto locked. |
| Change the severity and priority settings as required. Alert Suppression |
|
| Configure the alert suppression fields as depicted in the image. Ok |
|
| Create | |
|
Next steps:
|