Exchange mailbox export getting strange data

Welcome Forums General PowerShell Q&A Exchange mailbox export getting strange data

This topic contains 1 reply, has 2 voices, and was last updated by

3 years, 9 months ago.

  • Author
  • #28727

    Topics: 6
    Replies: 3
    Points: 41
    Rank: Member

    I have a script that does Exchange discovery & then exports to a .csv file.

    The script is hundreds of lines long but the relevant part is:

    $global:LocalMailboxes = Get-Mailbox -resultsize unlimited -ErrorAction Stop
    $global:LocalMailboxes | Export-CSV $global:logpath\Mailboxes_Export_$(Get-Date -UFormat %m-%d-%y_%H-%M-%S_%Z).csv -NoTypeInformation -Encoding UTF8 -ErrorAction Stop

    The problem is in some of the columns in the .csv file I don't receive the expected value.

    For the emailaddress column I get:


    Here is another example from the AcceptMessagesOnlyFrom column:


    Most of the columns have the correct values but about 25% do not. My question is how do I expose these missing values in my .csv export?

  • #28728

    Topics: 13
    Replies: 4872
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    That's because the data in those columns is not a single value, but rather a collection of objects – e.g., more than one Proxy Address. CSV isn't designed to handle that kind of hierarchy – they're 'flat file' format.

    You could potentially rig something, depending on what you want those multiple-value columns to look like, but it won't be a simple Export-CSV anymore. You're just asking more from CSV than it's designed to deliver :(.

The topic ‘Exchange mailbox export getting strange data’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort