{"id":227,"date":"2012-01-26T03:03:21","date_gmt":"2012-01-26T03:03:21","guid":{"rendered":"https:\/\/pipe2text.com\/?page_id=227"},"modified":"2012-01-29T13:17:58","modified_gmt":"2012-01-29T13:17:58","slug":"using-powershell-to-get-information-about-a-specific-folder-in-an-exchange-2010-mailbow","status":"publish","type":"page","link":"https:\/\/pipe2text.com\/?page_id=227","title":{"rendered":"Using PowerShell to Get Information about a Specific Folder in an Exchange 2010 Mailbox"},"content":{"rendered":"<p>Hi All,<\/p>\n<p>Sometimes you may have the need to get information about a folder in a users Exchange 2010 mailbox. For example, lets say you wanted to find information pertaining to a users &#8220;Contacts&#8221; folder. More specifically, you wanted to know how many contacts a mailbox contains. To find information about a user&#8217;s Contacts folder you can simply use the following command:<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>The Command<\/strong><\/span><br \/>\nget-mailboxfolderstatistics BC@pipe2text.com -FolderScope contacts<\/p>\n<p>Note: You could also use the alias for the mailbox and several other values instead of the SMTP address as shown above. See the help\u00a0for\u00a0the &#8220;get-mailboxfolderstatistics&#8221; cmdlet for more information.<\/p>\n<p>This command will give you the following information in the contacts folder in a users mailbox:<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>The Output<\/strong><\/span><\/p>\n<p>RunspaceId<br \/>\nDate<br \/>\nName<br \/>\nFolderPath<br \/>\nFolderId<br \/>\nFolderType<br \/>\nItemsInFolder<br \/>\nDeletedItemsInFolder<br \/>\nFolderSize<br \/>\nItemsInFolderAndSubfolders<br \/>\nDeletedItemsInFolderAndSubfolders<br \/>\nFolderAndSubfolderSize<br \/>\nOldestItemReceivedDate<br \/>\nNewestItemReceivedDate<br \/>\nOldestDeletedItemReceivedDate<br \/>\nNewestDeletedItemReceivedDate<br \/>\nOldestItemLastModifiedDate<br \/>\nNewestItemLastModifiedDate<br \/>\nOldestDeletedItemLastModifiedDate<br \/>\nNewestDeletedItemLastModifiedDate<br \/>\nManagedFolder<br \/>\nTopSubject<br \/>\nTopSubjectSize<br \/>\nTopSubjectCount<br \/>\nTopSubjectClass<br \/>\nTopSubjectPath<br \/>\nTopSubjectReceivedTime<br \/>\nTopSubjectFrom<br \/>\nTopClientInfoForSubject<br \/>\nTopClientInfoCountForSubject<br \/>\nSearchFolders<\/p>\n<p>\u00a0Now lets say you wanted the same information for all mailbox but you only wanted select properties to display. For this you could type the following command:<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>The Command<\/strong><\/span><\/p>\n<p>get-mailbox | get-mailboxfolderstatistics -FolderScope contacts |select identity,name,folderpath,foldertype,ItemsinFolder,foldersize<\/p>\n<p>The command above will only show the properties that have been added after &#8220;|select&#8221;.<\/p>\n<p>When running this for all mailboxes, it may be way to much information depending on the size of your organization and\u00a0it will fly by your screen way faster than you can read it. You may\u00a0notice that you\u00a0see some red errors because some mailboxes do not contain the folder you are looking for.\u00a0To have this information in a report that is easy to retrieve and read after the command is run, you can pipe it to a csv file for review.\u00a0To do this you can type the following command:<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>The Command<\/strong><\/span><\/p>\n<p>get-mailbox | get-mailboxfolderstatistics -FolderScope contacts |select identity,name,folderpath,foldertype,ItemsinFolder,foldersize | Export-Csv c:\\test\\AllMailboxContacts.csv<\/p>\n<p>This will output the\u00a0the information\u00a0to a csv file called &#8220;AllMailboxContacts.csv&#8221; in a folder called &#8220;test&#8221; (create folder before running command) on the c drive. Any errors for mailboxes not containing the folder you are searching for (in this case contacts) will show up in the PowerShell window for your review. All other info will be in the csv file.<\/p>\n<p>As with any PowerShell command you can use the help to find different ways of using the &#8220;get-mailboxfolderstatistics&#8221; cmdlet to obtain the information you need by typing the following command:<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>The Command<\/strong><\/span><\/p>\n<p>get-help get-mailboxfolderstatistics<\/p>\n<p>As always, I suggest testing this and any new commands you are using in a lab scenario. Hope this helps!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi All, Sometimes you may have the need to get information about a folder in a users Exchange 2010 mailbox. For example, lets say you wanted to find information pertaining to a users &#8220;Contacts&#8221; folder. More specifically, you wanted to &hellip; <a href=\"https:\/\/pipe2text.com\/?page_id=227\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"class_list":["post-227","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=227"}],"version-history":[{"count":14,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/227\/revisions"}],"predecessor-version":[{"id":248,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/227\/revisions\/248"}],"wp:attachment":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}