Mailboxes


Get-Mailbox

https://docs.microsoft.com/en-us/powershell/module/exchange/get-mailbox?view=exchange-ps



Shared Mailbox

https://docs.microsoft.com/en-us/exchange/collaboration-exo/shared-mailboxes


https://docs.microsoft.com/en-us/exchange/shared-mailboxes-exchange-2013-help



Getting Mailbox 

Get-Mailbox -Identity jon@contoso.com



Getting Mailbox stats


Get-MailboxDatabase | Get-MailboxStatistics | Sort displayname -desc | ft displayname, totalitemsize, itemcount | Out-File "c:\setup\\exch_name3.txt"

 

 

Get-MailboxDatabase | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount | Out-File "c:\setup\\exch_size3.txt"

 

 

Sorted A-Z

 

Get-MailboxDatabase | Get-MailboxStatistics | Sort displayname | ft displayname, totalitemsize, itemcount | Out-File "c:\setup\\exch_name_v3.txt"

 

Get-MailboxDatabase | Get-MailboxStatistics | Sort totalitemsize| ft displayname, totalitemsize, itemcount | Out-File "c:\setup\\exch_size_v3.txt"

 

 

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,TotalItemSize | Export-CSV c:\setup\\mailboxes.csv

 

Get-Mailbox -ResultSize Unlimited |Get-MailboxStatistics |Sort-Object totalitemsize -descending |ft displayname,database,emailaddresses,@{label=”TotalItemSize(MB)”;expression={$_.TotalItemSize.Value.ToMB()}} >>c:\setup\\reportdate.csv



Top 30 mailboxes in size order

Get-Mailbox -ResultSize unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Des | Select DisplayName,TotalItemSize -First 30


Mailbox

https://docs.microsoft.com/en-us/powershell/module/exchange/?view=exchange-ps#mailboxes


SendAs (Exchange Online only):

Add-RecipientPermission <mailbox> -AccessRights SendAs -Trustee <user>

 

Send On Behalf:

         Set-Mailbox –Identity  <mailbox> -GrantSendOnBehalfTo  <user>


Where <Mailbox> is the identity of the mailbox (or Distribution Group) you wish to apply permissions on and <user> the account that will receive these permissions.