If you want to make sure all your exMon users are active users in your corporate Active Directory you can use exMon to monitor the accounts for you.

In this guide we will query all disabled Active Directory users and compare those to all exMon users and send an email with all errors found.

 

Add Active Directory PowerShell support

To query Active Directory with PowerShell you will need to add the necessary support. Here you can find out how to configure it.

 

Configure the test

1. Create a new Compare Query in exMon Administrator by right clicking the Tests folder

2. In the left query select the PowerShell Data Provider and add the following PowerShell script:

import-module activedirectory
$exMonResult = Get-ADUser -Filter {Enabled -eq $false} | exMon-Out-DataTable

3. In the right query select exMon Data Provider and add the following PowerShell script:

declare @domain varchar(20)
set @domain = 'EXPECTUS'

select distinct
    substring(ad_name, len(@domain)+2, len(ad_name)) as ad_username
from dbo.c_user

 

4. Replace 'EXPECTUS' with your domain name

5. We only want users found in the disabled AD User query to create errors, not extra accounts not in exMon but not in AD so make sure "DS2 incl. DS1" is selected but "DS1 incl. DS2" is deselected.

 

 

6. Create a column mapping where the usernames are the keys and the name is an information column so it's easier to recognize the user.


7. Configure exception manager and schedule as usual.

 

Running the Preview will show you the results: