31.8 C
Dubai
Wednesday, September 22, 2021
spot_img

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 Manoharanhttps://www.azure365pro.com
Satheshwaran Manoharan is an Microsoft Office Server and Services MVP , Publisher of Azure365pro.com. Specialized in Office365 / Microsoft Exchange / Virtualization , Sathesh is an Messaging Expert supporting/Designing/Deploying many medium size businesses to large enterprises when it comes to Corporate messaging and Virtualization Infrastructure

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here