Exchange PowerShell Fun

We are currently migrating 12,000 mailboxes into Exchange Online from our Exchange 2007 environment. We have batched up our users based on various criteria and from time to time we have the need to make a migration list from a Distribution Group. Being a little bit too keen to write something myself, I disappeared down the rabbit hole and came up with 90 odd lines to expand a distribution list and its nested distribution lists. It was a daft mistake to doing more research before this because, there is a nice little commandlet that already exists in the ActiveDirectory PowerShell Module:

	Import-Module ActiveDirectory
	Get-ADGroupMember -Identity $Group -Recursive

Oh well! It was a useful excercise in developing a recursive function and understanding how to manage local vs global variables in PowerShell. They can be found at https://github.com/choicedraught/exchange.

@cd


© 2021. All rights reserved.

Powered by Hydejack v9.1.6