Friday, July 31, 2015

Nicely Retrieving Calendar Processing Information

Hi folks,

Just wanted to share with you a quick way to check if your meeting rooms accept invitations from the outside of the Exchange organization.

$MBX = Get-Mailbox -RecipientTypeDetails RoomMailbox -ResultSize Unlimited
$MBX |select DisplayName,@{N="External Calendar Processing";E={(Get-calendarprocessing -identity $_.Name).ProcessExternalMeetingMessages}}


Reporting Mailbox Usage Statistics

Hi folks,

Just wanted to share with you a script I have recently used to extract information about the mailboxes, their size and also dates of the newest and the oldest item. It can be extremely useful for planning activities when you're trying to identify the size of the mailboxes in your environment to plan potential migration traffic and also storage for Exchange or Office 365 migration activities.

I want to thank authors of this thread for giving me this hint.

As the result I have got something as below:

#This script can be run against a single mailbox, group of mailboxes or all mailboxes. All you need is to replace value for $mbx variable
#if you run it against a single mailbox set $mbx to something like $mbxs = Get-Mailbox -Identity john.smith
#if you run it against mailboxes in a certain region filter it by domain, like Get-Mailbox -Filter {EmailAddresses -Like "**"}
#If you run it against all mailboxse just use $mbxs = Get-Mailbox -ResultSizeUnlimited

$mbxs = Get-Mailbox -Filter {EmailAddresses -Like "**"} -ResultSize Unlimited
$mbxs | %{
    $newest = $oldest = $null
    $mb = $_
    $mb | Get-MailboxFolderStatistics -IncludeOldestAndNewestItems | %{
        if($_.NewestItemReceivedDate -and (!$newest -or $newest -lt $_.NewestItemReceivedDate.tolocaltime())){
            $newest = $_.NewestItemReceivedDate.tolocaltime()}
        if($_.OldestItemReceivedDate -and (!$oldest -or $oldest -gt $_.OldestItemReceivedDate.tolocaltime())){
                $oldest = $_.OldestItemReceivedDate.tolocaltime()}
    $stat = $mb | Get-MailboxStatistics
    New-Object -TypeName psobject -Property @{
        DisplayName = $mb.displayname
        SMTPAddress = $mb.PrimarySMTPAddress.tostring()
        TotalItemSize = $stat.TotalItemSize
        TotalItems = $stat.itemcount
        RetentionPolicy = $mb.retentionpolicy
        NewestItem = $newest
        OldestItem = $oldest    
} | Select-Object -Property DisplayName, SMTPAddress, TotalItems, TotalItemSize, RetentionPolicy, NewestItem, OldestItem |
    Export-Csv "D:\Scripts\MbxStats.csv" -NoTypeInformation

It will be output into the nice and readable Excel file like this:


Who Has Send-As Permissions to Mailbox

Hi folks,

Here is a quick way to retrieve who has Send-As permission to a mailbox in Exchange server environment.

Get-Mailbox |Get-ADPermission|Where-Object {$_.extendedrights -like "*send*"} |select Identity,User,@{N="Access Rights";E={$_.AccessRights}}|Export-Csv Send-As.csv

We end up with the nice Excel spreadsheet as below:


Quickly Retrieving Information on Receiving Connectors

Hi folks,

Just wanted to share with you a quick way to retrieve information about receive connectors on Exchange 2010/2013 servers.

As you know receive connectors are managed on transport (mailbox) servers and in order to retrieve information you need to retrieve receive connector information from every server. This is when standardization is helpful even in big environments.

So, let's imagine that you have large and highly standardized environment. On every transport server you have a receive connector named "From Internet" which is used to receive information from outer world and you need to retrieve information about it.

The 2 following strings help you to retrieve the information about the receive connector named "From Internet" from all hub transport (or mailbox) servers in your environment.

1st we create variable for all the transport servers in environment:

For Exchange 2007/2010 it will be:

$TrpSrv = Get-TransportServer -Identity *EX0* |sort Name

For Exchange 2013 and later:

$TrpSrv = Get-TransportService -Identity *EX0* |sort Name

And as soon as we have variable populated against every server in variable we execute command like below:

$TrpSrv |foreach {Get-ReceiveConnector -Server $_.Name |where {$_.Name -like "*Internet*"}}