Skip to content

Instantly share code, notes, and snippets.

@Apoc70
Created June 1, 2023 10:59
Show Gist options
  • Save Apoc70/2430457cb43ef93840757d4efa6e39c2 to your computer and use it in GitHub Desktop.
Save Apoc70/2430457cb43ef93840757d4efa6e39c2 to your computer and use it in GitHub Desktop.
# Fetch all mail users
$DomainNameFilter = '*varunagroup.de'
Get-MailUser -ResultSize Unlimited | ?{$_.ExternalEmailAddress -like $DomainNameFilter} | Sort-Object DisplayName | Select-Object DisplayName, PrimarySmtpAddress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment