22 C
Monday, February 6, 2023

Enable Remote Mailbox and Archive using CSV

To Export Specific OU for example to Enable Remote mailboxes

Get-ADuser -SearchBase "Distingushedname" -filter *  | Select-Object samaccountname,userprincipalname | Export-csv userdump.csv

Take CSV and replace user principal name with remote routing address. if you wish to populate remote mailboxes for a specific Organizational Unit. Make sure you replace it with your appropriate remote routing address specific to your Office 365 tenant.

Import-Csv EnableRemoteMailboxes.csv | ForEach-Object{new-RemoteMailbox -Identity $_.samaccountname -remoteroutingaddress $_.userprincipalname}

Use the Attached CSV. Fill with samaccountname and enable archive mailboxes in bulk

Import-Csv accounts.csv | ForEach-Object{Enable-RemoteMailbox -Identity $_.samaccountname -Archive}

Always specify remote routing address while enabling remote mailboxes otherwise powershell will throw up the below error.

The error – for the purposes of people searching for it is The Address @tenantname.mail.onmicrosoft.com is invalid: “@tenantname.mail.onmicrosoft.com” isn’t a valid SMTP address.
The domain name can’t contain spaces and it has to have a prefix and a suffix, such as example.com. 
FullyQualifiedErrorID : F0109C5E,Microsoft.Exchange.Management.Recipient.Tasks.EnableRemoteMailbox.
Satheshwaran Manoharan
Satheshwaran Manoharanhttps://www.azure365pro.com
Specialized in Microsoft Azure - Office 365 / Microsoft Exchange; conducted numerous projects worldwide in designing, supporting, and implementing messaging and virtualization infrastructure for medium-sized and large enterprises. Further, I am a Cloud Architect and Technical Advisor for various start-ups.

Related Articles


Please enter your comment!
Please enter your name here

× How can I help you?