Get-ExchangeServer | Where {$.IsHubTransportServer -eq "true"} | Get-Queue | Where {$_.Deliverytype -eq "MapiDelivery"} | Select-Object Identity, NextHopDomain, Status, MessageCount
Get-Mailbox -resultsize unlimited | Get-MailboxFolderStatistics -folderscope outbox | Sort-object foldersize -Descending | Select-Object Identity,Name,Foldertype,itemsinfolder,@{Name="FolderSize MB";expression={$_.folderSize.toMB()}}
Get-Mailbox -ResultSize unlimited | Format-Table Name,MaxSendSize,MaxReceiveSize
New-MailboxExportRequest -Mailbox user -FilePath "\\fileserver\mailboxgraveyard\user.pst"
Get-MailboxExportRequest
Get-MailboxDatabase
) and use the following command to see if there are any disconnected mailboxes:Get-MailboxStatistics -Database "<DB NAME>" | Where-Object {$_.DisconnectDate -Notlike $NULL} | FL DisplayName, DisconnectDate, MailboxGuid
Remove-Mailbox -Database "<DB NAME>" -StoreMailboxIdentity <MAILBOXGUID>
Get-MailboxDatabase | Get-MailboxStatistics | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Sort-Object TotalItemSize -Descending | Export-CSV C:\temp\mailboxes.csv
Get-MessageTrackingLog -Recipients:[email protected] -Start "3/1/2018 1:00:00 AM" -End "3/14/2018 11:00:00 PM" | Select {$_.Recipients}, {$_.RecipientStatus}, * | Export-Csv C:\temp\user-emails.csv
Get-ActiveSyncDevice | Select-Object DeviceModel,FriendlyName,DeviceOS,UserDisplayName,Identity | Sort-Object DeviceModel | Export-CSV -Path C:\temp\activesyncusers.csv
Get-ActiveSyncDeviceStatistics -Mailbox:"username" | Select-Object Guid,Identity,DeviceModel,LastSuccessSync | Sort-Object LastSuccessSync
Remove-ActiveSyncDevice <GUID>
$OldDevices = Get-ActiveSyncDevice -ResultSize unlimited | Get-ActiveSyncDeviceStatistics | where {$_.LastSyncAttemptTime -lt (Get-Date).AddDays(-365)}
$OldDevices | foreach-object { Remove-ActiveSyncDevice([string]$_.Guid) -confirm:$false }
Get-CASMailbox | Where {$_.OWAEnabled} | ft DisplayName,OwaEnabled
Set-CASMailbox -Identity appledeveloper -OWAEnabled $false
$mbxs = Get-Mailbox; foreach ($mbx in $mbxs) { Set-CASMailbox -Identity $($mbx.Alias) -OWAEnabled $false }