Exchange 2010 count mailbox mobile devices partnership

In Exchange Server environment where is a limit of ActiveSync partnership with mailbox.

When you reach this limit then you won’t be able to connect any new devices to the mailbox.

This limit is set in ThrottlingPolicy using parameter EASMaxDevices

To check current setting of EASMaxDevices, open Exchange Management Shell and run:

Get-ThrottlingPolicy | select name, EASMaxDevices, EASMaxConcurrency


As a result you will get all ThrottlingPolicies available in Exchange environment and how many mobile devices can you connect to the mailbox, and also using EASMaxConcurrency you will see how many connections in one time can be accepted to the mailbox.



Continue reading

Print Friendly

Exchange 2010 get list of mailboxes with logon time information

Below you can find script which will return all mailboxes where LastLogonTime is older than 90 days ago.

You can easly set this date in variable $days.


Function New-Array {,$args}
$Report = New-Array

$days = "90"

$date_last = (Get-Date).AddDays(-$days) 
$mailboxes = Get-Mailbox -server mxmbx01 -ResultSize unlimited

foreach($mailbox in $mailboxes) 
  $mbx_DN = $mailbox.DistinguishedName 
  $email = $mailbox.PrimarySmtpAddress.toString()
  $Stat = Get-MailboxStatistics -Identity $mbx_DN | Where-Object {$_.lastLogonTime -lt $date_last} | Select-Object DisplayName, totalitemsize,LastLogonTime

 if ($Stat){
  $tmp = New-Object System.Object
  $tmp | Add-Member -type NoteProperty -name DisplayName -value $($stat.DisplayName)
  $tmp | Add-Member -type NoteProperty -name Email -value $email
  $tmp | Add-Member -type NoteProperty -name TotalSize_MB -value $($stat.TotalitemSize.value.ToMB())
  $tmp | Add-Member -type NoteProperty -name LastLogon -value $($stat.LastLogonTime)
  $Report += $tmp
$Report | Export-Csv D:\Scripts\lastlogon_report.csv


As a result of this script, you will get .csv file, with informations DisplayName, email address, size of mailbox in MB, and last logon time.



Print Friendly

Distribution Groups nested – get list only groups

Recently, we described how to obtain a list of all mailboxes in the group that has nested distribution groups.

Unfortunately, using this method, you can not get a list of groups in a distribution group, only users (mailboxes).

To obtain this list, you need to write more or less complicated powershell script or use the additive Quest Powershell Module for Active Directory.


After installation of Quest Module, run powershell console and run:

add-PSSnapin quest.activeroles.admanagement

Continue reading

Print Friendly

Get distribution group all members – nested

How can we get a list of mailboxes belonging to a distribution group?
In a simple way, by using the EMC console and check who is a member of a group, or by using powershell EMS console and use the command:

Get-DistributionGroupMember Test_Group


In this way we get a list of objects in the group, both mailboxes, contacts, and other groups.

And here there is a problem, because if the distribution group includes the next distribution group, and this again next etc, how can we get a list of all people who receive an email after sending a message to a distribution group?

Unfortunately, using only the Get-DistributionGroupMember we won’t get such information.

This command returns only the objects directly in a group, without nesting.

In this case, we have to use PowerShell commands for Active Directory available.

To do this run EMS console and import the Active Directory module command as follows:

import-module ActiveDirectory

Continue reading

Print Friendly

Exchange 2010 list connections to OWA

If you want to get to know how your users are using OWA to connect to mailboxes you can use following two solutions.

In any environment where Microsoft Exchange OWA service is enabled for user mailboxes, we can check how many users actually use OWA access through their mailboxes.

The first solution presents how to check the number of current connections to the mailbox using OWA.

For this purpose, we need to run this script by calling the Get-CASActiveUsers for all servers that provide OWA connections, so mostly for all CAS servers.


Following script will list all current connections to OWA and RPC on CAS servers:


Continue reading

Print Friendly

Microsoft Exchange get sent emails list – messagetrackinglog

emailRecently we wrote about how to find all the all recipients of the email:

Exchange MessageTrackingLogs get recipients list



Now we will present a powershell script that will help us generate statistics of sent emails.


However, we are not interested in the amount of all outgoing e-mails, their size, but we will focus on emails sent outside of our Exchange organization and get information about the addresses from which they were sent, with which the subject, how many of these emails and how many recipients receive those emails.

This script allows you to obtain information about the senders e-mail addresses that send many messages out.
This script is based on checking the Transport Logs located on Exchange servers with the Hub Transport roles.

After receiving the results of the script you can use the script in the previous post and find out to whom the message was sent, then you will get list of all recipients of this email.


Below we explain how this script work.:

First script part conatins:

  • powershell object definitions
  • paths to output files with emails statistic
  • settings to send email with alert to admin
  • $MAX_Recipients – number of recipients which define when to generate alert sent by email


Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
Set-AdServerSettings -ViewEntireForest $True

Function New-Array {,$args}

$Report = New-Array
$Report_SMTP = New-Array
$Rep_sum = New-Array
$Rep_SMTP_sum = New-Array

$data = $($((get-date).adddays(-1)).ToString('yyyy.MM.dd'))

#paths to output files
$Out_Rep_file = "d:\Scripts\Logs\Stats\msg_stat_out_$data.csv"
$Out_Rep_sum_file = "d:\Scripts\Logs\Stats\msg_stat_out_sum_$data.csv"

#files with emails with smtp traffic
$Out_Rep_SMTP_file = "d:\Scripts\Logs\Stats\msg_stat_smtp_out_$data.csv"
$Out_Rep_SMTP_sum_file = "d:\Scripts\Logs\Stats\msg_stat_smtp_out_sum_$data.csv"
#file with report attached to email (emails recipients grater than $MAX_Recipients)
$Email_HTML_File = "d:\Scripts\Logs\Stats\Report_outgoing_emails_$data.htm"

#settings for email with report
$mail_from = ""
$mail_to = ""
$mail_smtp_host = "smtpserver.domain.local"
$mail_subject = "Report outgoing emails $data"

#variable that defines the threshold for recipients to write to email report
$MAX_Recipients = 100

Continue reading

Print Friendly

Exchange MessageTrackingLogs get recipients list

From time to time we need to get a list of all persons to whom the email was sent with a given subject.

The list of recipients in a fairly simple way we can get from the transaction logs which are located on Exchange servers with HT roles.

Of course, before you do this, you have to configure your environment so that the transaction logs are kept for a few days on the servers.

The following script returns a list of recipients to whom the email was sent with the subject “Test mail”, but we are interested in the time of dispatch of the last day.

Number of days is defined in $DAYS and subject in $SUBJECT.

Script you can find below:

Continue reading

Print Friendly

List Exchange mailbox folder permissions – script

Sometimes you add permissions to mailbox folders for other users.

You can check permission to mailbox folder using Outlook but then you need to check each folder.

If you want to get list of permissions assigned for users to specified mailbox folders you can use below script.

In this script we use Get-MailboxFolderStatistics to get list of mailbox folders and subfolders, and  Get-MailboxFolderPermission to get permissions assigned to those folders and subfolders.

When we connect both commands we will get script which will list all permissions assigned to all folders and subfolders in mailbox.

To check specified mailbox, assign mailbox alias or smtp address to variable $MBX_tocheck

Continue reading

Print Friendly

Exchange 2010 get information about mailbox size

Information about the amount of space that occupies a particular mailbox, we can easily preview the Exchange Management Console.

Unfortunately, if we want to get more information about the mailboxes, or mailboxes that meet that special condition, the realization of such a task in the EMC will be very time consuming.

In such a case comes to us from the console using the Exchange Management Shell (EMS) in which the PowerShell commands, we can get a lot of interesting information on the mailboxes located on Microsoft Exchange.

Display all information about the mailbox:

Get-MailboxStatistics | FL

Continue reading

Print Friendly

Exchange 2010 Powershell how to count mailboxes

We often encounter the need to determine how many mailboxes in a given time is in different databases or around the Microsoft Exchange Server.

Such information can be easily obtained by using the Exchange Management Shell cmdlets for Exchange 2010.

Examples of use:

Determination of the number of all mailboxes in an Exchange Organization


(Get-Mailbox -ResultSize unlimited).count

ResultSize option we use if our Exchange environment has more than 1000 mailboxes

Number of mailboxes in different databases:

Get-Mailbox -ResultSize unlimited | Group-Object -Property:Database | Select-Object Name,Count

Continue reading

Print Friendly