Exchange 2010 list connections to OWA

This post is also available in: Polish

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:


function Get-CASActiveUsers {
 [Parameter(Position=0, ParameterSetName="Value", Mandatory=$true)]
 [Parameter(Position=0, ParameterSetName="Pipeline", ValueFromPipelineByPropertyName=$true, Mandatory=$true)]

process {
 switch($PsCmdlet.ParameterSetName) {
 "Value" {$servers = $ComputerName}
 "Pipeline" {$servers = $Name}
 $servers | %{
 $RPC = Get-Counter "\MSExchange RpcClientAccess\User Count" -ComputerName $_
 $OWA = Get-Counter "\MSExchange OWA\Current Unique Users" -ComputerName $_
 New-Object PSObject -Property @{
 Server = $_
 "RPC Client Access" = $RPC.CounterSamples[0].CookedValue
 "Outlook Web App" = $OWA.CounterSamples[0].CookedValue
Get-CASActiveUsers -ComputerName srvCAS01, srvCAS02, srvCAS03


As a result of executing the script, we will get the number of sessions divided into OWA and RPC connections for each server.


The second solution is focused on searching for all users who connect to the mailbox using OWA in a given period of time.

For this purpose, we use the IIS logs available on servers with roles CAS and LogParser.

Log Parser can be downloaded here:

Log Parser 2.2


After installing the program, we have to copy the IIS logs of the CAS servers to a single directory, or if you have one CAS server, we can immediately identify a path to it in the script.

If you have more than one server, we need to copy the logs, changing their names so as not to be overwritten with another server logs.

Next we run Log Parser and write:

"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" -i:IISW3C "SELECT cs-username FROM z:\IISLogs\*.log WHERE cs-method LIKE 'GET' AND cs-uri-stem LIKE '/OWA/%' AND cs-username IS NOT NULL GROUP BY cs-username" -o:csv -q:off > D:\OWALogins.csv


We need to specify input files type:  -i: IISW3C

Next we select user name (cs-username) from IIS logs copied to directory z:\IISLogs

Then we specify that we are interested only appeal to OWA, and the GET method.

At the end we group the results by the user account name and save the result to a file OWALogins.csv


Print Friendly
Tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>