The In-Place Archive that you get with Exchange Online, provides your users with additional storage space. With PowerShell we can enable the archive mailboxes quickly for all users.
Connect to Exchange Online
First we need to connect to Exchange Online, you can use this connector script or run the following code:
1. #Create credential object 2. $credObject = Get-Credential 3. 4. #Import the Exchange Online ps session 5. $ExchOnlineSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credObject -Authentication Basic -AllowRedirection 6. Import-PSSession $ExchOnlineSession
Or with the connector script:
1. ConnectTo-ExchangeOnline.ps1
Get a list of users without In-place Archive
To check if there are users without the archive mailbox, you can run the following cmdlet
1. Get-Mailbox -Filter {ArchiveStatus -Eq "None" -AND RecipientTypeDetails -eq "UserMailbox"}
Enabling the archive
You can enable the archive for a single user with the following cmdlet
1. Enable-Mailbox -Identity "<user>" -Archive
Or for all users at once with
1. Get-Mailbox -Filter {ArchiveStatus -Eq "None" -AND RecipientTypeDetails -eq "UserMailbox"} | Enable-Mailbox -Archive
more info: https://technet.microsoft.com/en-us/library/jj984357%28v=exchg.150%29.aspx?f=255&MSPPError=-2147217396