locked
Edit powershell outpu RRS feed

  • Question

  • Hi Team,

    I am running this command get-mailbox user@domain.com | select-object expandproperty emailaddresses | export-csv c:\users\...

    It exports a set of aliases in a csv file, the aliases starts with prefix starting with SMTP: or SIP: or smtp:

    What modifications should i make in this command so that it return aliases without any prefix SMTP/smtp ..

    Regards,

    Harshit Malhotra

    Monday, January 6, 2020 4:02 PM

All replies

  • ForEach-Object{ $_ -replace 'SMTP:|smtp:|SIP:'}

    Your output is NOT a CSV.  It is just a plain text file.


    \_(ツ)_/

    Monday, January 6, 2020 4:56 PM