Last active
August 29, 2015 14:21
-
-
Save alexinnes/ede23fbd07668d2426c2 to your computer and use it in GitHub Desktop.
Gets Mailboxes from specified server, lists: Name, last login time, size and which server its located on.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Database name you want to get all mailboxes from | |
#Add * on the end for a wildcard | |
$database = "PER*" | |
#Output File name | |
$Filename = "Export.csv" | |
#Where you want to export the file | |
$Path = "C:\" | |
$export = "$Filename$Path" | |
#Gets all mailboxes in specified database, returns them with Name, How big they are, their last log in time and where they are located. and outputs them to a CSV | |
get-mailbox | where{$_.database -like "$database"} |get-mailboxstatistics| select -Property displayname, totalitemsize, lastLogonTime, servername | export-csv $export |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment