使用 PowerShell 为所有用户启用就地存档
通过 Exchange Online 获得的就地存档可为您的用户提供额外的存储空间。借助 PowerShell,我们可以为所有用户快速启用存档邮箱。
连接到 Exchange Online
首先,我们需要连接到 Exchange Online,您可以使用此连接器脚本或运行以下代码:
#Create credential object
$credObject = Get-Credential
#Import the Exchange Online ps session
$ExchOnlineSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credObject -Authentication Basic -AllowRedirection
Import-PSSession $ExchOnlineSession或者使用连接器脚本:
ConnectTo-ExchangeOnline.ps1获取没有就地存档的用户列表
要检查是否存在没有存档邮箱的用户,可以运行以下 cmdlet
Get-Mailbox -Filter {ArchiveStatus -Eq "None" -AND RecipientTypeDetails -eq "UserMailbox"}启用存档
您可以使用以下 cmdlet 为单个用户启用存档
Enable-Mailbox -Identity "<user>" -Archive
或者同时为所有用户提供
Get-Mailbox -Filter {ArchiveStatus -Eq "None" -AND RecipientTypeDetails -eq "UserMailbox"} | Enable-Mailbox -Archive更多信息:https://technet.microsoft.com/en-us/library/jj984357%28v=exchg.150%29.aspx?f=255&MSPPError=-2147217396