160k views
1 vote
Powershell: Return the number of active mailboxes and the total number of mailboxes

a) Get-Mailbox -RecipientTypeDetails
b) Measure-Object -Property
c) Enable-Mailbox -Status
d) Add-Mailbox -TotalCount

1 Answer

4 votes

Final answer:

To return the number of active mailboxes and the total number of mailboxes using PowerShell, you can use the Get-Mailbox cmdlet with the -RecipientTypeDetails parameter and pipe the output to Measure-Object cmdlet to get the count.

Step-by-step explanation:

The subject of this question is Computers and Technology and the grade level is College.

To return the number of active mailboxes and the total number of mailboxes using PowerShell, you can use the Get-Mailbox cmdlet with the -RecipientTypeDetails parameter. This cmdlet retrieves mailbox information based on recipient type details.

An example of the command would be:

Get-Mailbox -RecipientTypeDetails 'UserMailbox'

This will give you the count of active mailboxes. To get the total number of mailboxes, you can pipe the output of the Get-Mailbox cmdlet to the Measure-Object cmdlet with the -Property parameter.

An example of the command would be:

Get-Mailbox -RecipientTypeDetails 'UserMailbox' | Measure-Object -Property 'RecipientTypeDetails'

This will provide you with the total count of mailboxes.

User Pawel Maga
by
8.2k points