How to Determine active mailboxes connected on Exchange Server 2010 Client Access

Here a very good script from Mike Pfeiffer quick way to check how many users connected to client access server using exchange 2010 monitor counters

We need to know how many users will get effected if we have a downtime, With the help of performance counters we can identify the no of users currently active in CAS servers RPC or OWA.

You can also go through a complete list of counters for exchange 2010 CAS and Mailbox

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

Copy it in the NotePad and save with PS1 format

Open the Exchange Management Shell

Here I have used dot sourced before the script and also there is space between dot and then location of your script otherwise it won’t work.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s