Exchange online - Find all mailboxes that have ActiveSync enabled

As many of you have seen that starting 1 October 2022, Microsoft will start disabling Basic Auth on Tenants. This means disruption for many users that make use of EAS and are using the native mail applications on Android and iOS.

I put together a script that will help you find all these mailboxes with ActiveSync enabled and if you have multiple states or countries, you will get the output per country and you can filter excel by True or False or Country. The script is straight forward, you can modify it to suit your needs:

Connect-ExchangeOnline $EASCheck = Get-ADUser -Searchbase "OU=Users,DC=thexchangelab,DC=com" -Server dc1.thexchangelab.com -Filter * -Properties * | select userprincipalname,C $EASEnabledTotal = @() ForEach ($e in $EASCheck) { $easenabled = Get-CASMailbox -Identity $e.userprincipalname | Select Displayname,primarysmtpaddress,activesyncenabled Foreach ($u in $easenabled){         $Userobject = New-Object PSobject         $UserObject | add-member  -membertype NoteProperty -name "Userprincipalname" -Value $e.Userprincipalname         $UserObject | add-member  -membertype NoteProperty -name "Country" -Value $e.C         $UserObject | add-member  -membertype NoteProperty -name "Displayname" -Value $u.Displayname        $UserObject | add-member  -membertype NoteProperty -name "primarysmtpaddress" -Value $u.primarysmtpaddress         $UserObject | add-member  -membertype NoteProperty -name "activesyncenabled" -Value $u.activesyncenabled         $EASEnabledTotal += $Userobject} } $EASEnabledTotal | Export-Csv "C:\Temp\ASCNT01Sep.csv