Get number of most common Microsoft Exchange resources using PowerShell.
SCRIPT:
# get number of resources and save it into variables
$Mailboxes = (Get-Mailbox -ResultSize Unlimited).count
$UserMailboxes = (Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox).count
$RoomMailboxes = (Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails RoomMailbox).count
$SharedMailboxes = (Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails SharedMailbox).count
$Contacts = (Get-Contact -ResultSize Unlimited).count
$MailContacts = (Get-MailContact -ResultSize Unlimited).count
$DistributionGroups = (Get-DistributionGroup -ResultSize Unlimited).count
$MailGroups = (Get-DistributionGroup -ResultSize Unlimited -RecipientTypeDetails MailUniversalDistributionGroup).count
$SecurityGroups = (Get-DistributionGroup -ResultSize Unlimited -RecipientTypeDetails MailUniversalSecurityGroup).count
# output
Write-Host "--------------------------------"
Write-Host "--Number of Exchange resources--" -ForegroundColor Yellow
Write-Host "--------------------------------"
Write-Host "Mailboxes: $Mailboxes"
Write-Host "User mailboxes: $UserMailboxes"
Write-Host "Room mailboxes: $RoomMailboxes"
Write-Host "Shared mailboxes: $SharedMailboxes"
Write-Host "Contacts: $Contacts"
Write-Host "Mail contacts: $MailContacts"
Write-Host "Distribution Groups: $DistributionGroups"
Write-Host "Mail Distribution groups: $MailGroups"
Write-Host "Mail Security groups: $SecurityGroups"
No comments:
Post a Comment