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

https://technet.microsoft.com/en-us/library/ff367877(v=exchg.141).aspx

function Get-CASActiveUsers {
[CmdletBinding()]
param(
[Parameter(Position=0, ParameterSetName=”Value”, Mandatory=$true)]
[String[]]$ComputerName,
[Parameter(Position=0, ParameterSetName=”Pipeline”, ValueFromPipelineByPropertyName=$true, Mandatory=$true)]
[String]$Name
)

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.

2