//// connect to exchange online powershell /////
Install exchange online management
More Details:
https://docs.microsoft.com/en-us/powershell/exchange/connect-to-exchange-online-protection-powershell?view=exchange-ps
Connect to exchange online powershell with MFA
Set-ExecutionPolicy RemoteSigned
Install-Module -Name ExchangeOnlineManagement
Import-Module ExchangeOnlineManagement
Get-Module ExchangeOnlineManagement
Update-Module -Name ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName sin@domain.com -DelegatedOrganization youdomain.onmicrosoft.com
/////// get retentionpolicy info ///////
Get-Mailbox | FL RetentionPolicy
/// get retentionholdeenable /////////// make it is set to false ////
Get-Mailbox “sin@domain.com” | Select RetentionHoldEnabled
/// if the status is true , set it to $false //////
Set-Mailbox “sin@domain.com” -RetentionHoldEnabled $false
//// Enable online archive //////
Enable-Mailbox -Identity “” -Archive
/// force start archive job //////
Start-ManagedFolderAssistant -Identity “sin@domain.com”
–//// Enalbe AutoExpandingArchive —//////
Enable-Mailbox sin@domain.com -AutoExpandingArchive
////////////Get-MailboxStatistics ///////////
Get-MailboxStatistics -Identity sin@domain.com -Archive | Select DisplayName, TotalItemSize, ItemCount