AD OU Creation and Deletion Alert

Active Directory (AD) is the backbone of many organizations’ IT infrastructure, providing a centralized system for managing users, computers, and other resources. As your organization grows, efficient AD management becomes crucial. One aspect of effective AD administration is keeping track of organizational unit (OU) changes, especially creations and deletions. In this blog, we’ll explore how to leverage PowerShell to set up alerts for AD OU creation and deletion.

This came to us as a new tool is being implemented in the environment and that tool team needs information if Active directory Organizational Unit is Created or Deleted.

We have built the below Scripting solution that you can schedule to run daily which will send alert for any changes that occurs for Organizational Unit structure.

Prerequisites for this Solution:

Download the script from Git or PowerShell gallery from below links:

Git:

https://github.com/VikasSukhija/Downloads

newadoualert.ps1

PowerShell Gallery:

https://www.powershellgallery.com/packages/newadoualert

Install-Script -Name newadoualert

Update the Variables in below section as per your environment after downloading the script.

Now you can schedule the script from the task scheduler.

Note: Script on first run will generate the OU file in temp folder.

This file is required to compare the changes, when a change occurs from previous file state to current state then an alert is generated.


Alert will be like below screenshot:


I hope this solution will assist you in creating alert for any OU creation or deletions.

 

 

Thanks for reading and downloading…

Tech Wizard

 

https://techwizard.cloud

PowerShell Fast Track

 

Leave a comment