Let’s say you have 100 mailboxes and you want to remove the smtp address in bulk, below are the steps you can follow in order to do so.
Open Exchange Shell as administrator.
Run the below two (2) commands one after the other.
$qwe= get-content c:\New Folder\user.csv | Get-Mailbox
$qwe | set-mailbox -emailaddresspolicyenabled:$True
Then run the below script and press enter two times.
________________________________________________________________
foreach($i in Get-Content c:\New Folder\user.csv | Get-Mailbox -ResultSize Unlimited) {
$i.EmailAddresses |
?{$_.AddressString -like ‘*@domain.com’} | %{
Set-Mailbox $i -EmailAddresses @{remove=$_}
}
}
___________________________________________________________________