1

I try to get FolderPath for Exchange Mailboxes like this:

get-mailbox | select Name,@{L="FoldePath";E={(Get-MailboxFolderStatistics $_.Name).folderpath}}

This gives me the following output:

Name       FoldePath
----       ---------
User01     {/Top of Information Store, /Calendar, /Contacts, /Delet...
User02     {/Top of Information Store, /Calendar, /Contacts, /Delet...

That's good, but when I try to get FolderPath for a single mailbox, it returns empty output.

get-mailbox User01 | select Name,@{L="FoldePath";E={(Get-MailboxFolderStatistics $_.Name).folderpath}}
Name        FoldePath
----        ---------
User01

Format-Table returns correct output:

get-mailbox User01 | ft Name,@{L="FoldePath";E={(Get-MailboxFolderStatistics $_.Name).folderpath}}
Name    FoldePath
----    ---------
User01  {/Top of Information Store, /Calendar, /Contacts, /Delet...

Can I get correct output with Select-Object cmdlet? What is the difference?

Jeroen
  • 60,696
  • 40
  • 206
  • 339
Apollo
  • 11
  • 2

0 Answers0