Count of Mailbox Created in last Week/Month

 

We always for some reason need to find the count of the mailbox created in last week/Month etc. Below is the powershell command to get the count

$Result = Get-Mailbox -resultsize unlimited | where {$_.WhenCreated -gt (get-date).AddDays(-30)} | Select displayName
$Result.Count

To get the details to the text file you can use the below mentioned command to export to the text file

Get-Mailbox -resultsize unlimited | where {$_.WhenCreated -gt (get-date).AddDays(-30)} | Select displayName, Servername,Database, WhenCreated >> Result.txt

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