26 C
Dubai
Thursday, December 26, 2024

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
Award-winning Technology Leader with a wealth of experience running large teams and diversified industry exposure in cloud computing. From shipping lines to rolling stocks.In-depth expertise in driving cloud adoption strategies and modernizing systems to cloud native. Specialized in Microsoft Cloud, DevOps, and Microsoft 365 Stack and conducted numerous successful projects worldwide. Also, Acting as a Technical Advisor for various start-ups.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

× How can I help you?