Skip to content
May 9, 2016 / Don

A script to get a count of the number of users per server per DAG

Shared from Ron Williams @ https://r0nwilliams.wordpress.com/

A script to get a count of the number of users per server per DAG:

##Script start

$AllData = New-Object System.Collections.ArrayList
$Dags = Get-DatabaseAvailabilityGroup
foreach ($Dag in $Dags)
{
foreach ($Server in $Dag.Servers)
{
$Count = (get-mailbox -Server $Server -ResultSize unlimited).count
$Object = New-Object PSCustomObject -Property @{
ServerName = $Server
Users =       $Count
DAGName = $Dag.Name
}
[void]$AllData.Add($Object)
}
}
$AllData

 

 

Looks like:

t

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: