Powershell -expandproperty syntax issue

Anonymous
2017-04-13T09:30:44+00:00

The following Powershell command does not give the results expected:

get-recipient | Select-Object -property DisplayName -ExpandProperty emailaddresses

As per (example 2):

https://msdn.microsoft.com/powershell/reference/5.1/Microsoft.PowerShell.Utility/Select-Object

What am I doing wrong?

Thanks in advance

David (Nobby) Barnes

Microsoft 365 and Office | Subscription, account, billing | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2017-04-24T20:44:10+00:00

    Hi David,

    After consulting our related team, we can achieve your goal via the following “piped-command”:

    Get-Recipient |ft Displayname, RecipientType, PrimarySmtpAddress, EmailAddresses –Wrap

    Thanks,

    Gary

    1 person found this answer helpful.
    0 comments No comments

12 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-04-23T15:16:53+00:00

    Hi David,

    Thanks for your sharing. I have tried the script you provided above and it works find. To see if we can achieve your goal via just one cmdlet or two cmdlets, I am consulting our related team and will post back if I get any updates.

    Thanks,

    Gary

    0 comments No comments
  2. Anonymous
    2017-04-24T10:39:10+00:00

    Hi David,

    Thanks for your sharing. I have tried the script you provided above and it works find. To see if we can achieve your goal via just one cmdlet or two cmdlets, I am consulting our related team and will post back if I get any updates.

    Thanks,

    Gary

    Many thanks

    David (Nobby) Barnes

    0 comments No comments
  3. Anonymous
    2017-04-28T12:25:11+00:00

    Way to go..

    That is pretty damned close..

    Ace..

    Many thanks :)

    I know this doesn't expand the 'EmailAddresses' so they are neatly one line each..

    But for a quick report for management and the ability to view/search all addresses on the system, this will do nicely..

    Many thanks

    David (Nobby) Barnes

    0 comments No comments
  4. Anonymous
    2017-04-29T09:31:24+00:00

    Hi David,

    All Right. If you have any other questions when using Office 365 in future, please feel free to post a new thread in our forum.

    Best Regards,

    Amanda

    0 comments No comments