PowerShell: Reconcile Exchange Online Distribution List

First, I’ll note that there are optimizations, and other methods, to accomplish this same task. I wanted to put out something that was easily understood and implemented.

Purpose: This is a PowerShell script logs into Office 365, queries for disabled and unlicensed accounts, and removes those accounts from a specific Exchange online distribution group.

It also has the ability to use a custom exclusion list. The PowerShell script is meant to be run from a Windows server with appropriate PowerShell modules loaded via the Task Manager service. It can adapted to
Microsoft System Center Configuration Manager or Azure Automation Runbook functionality.

Caution: The script uses encrypted user credentials to store credentials for connecting to Office 365. While it is encrypted it is not the most secure method.

You can view my other Github repos at: Github: jtbarrera

Please follow and like us:

You may also like...

WordPress Appliance - Powered by TurnKey Linux