Determine whether a user has an online archive using PowerShell
A user posted a question on Windows 2012 Forums asking if it is possible to determine whether or not a user has an online archive using PowerShell. This is indeed possible, and here is how:
$Mailbox = Get-Mailbox user@yourdomain.com
$Mailbox.ArchiveDatabase
The following can be used in a script to return a True or False value:
$Mailbox = Get-Mailbox user@yourdomain.com
$Database = $Mailbox.ArchiveDatabase
If($Database -Eq $Null)
{
Write-Host "The user does not have an online archive"
}
Else
{
Write-Host "The user has an online archive"
}