Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$.EmailAddresses |Where-Object {$<\/em>.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}}<\/p>\n
Not familiar with looping arrays and how to export the result to powershell.<\/p>\n
I’m more familiar with returning information that I need from exchange and AD and just being able to Export-CSV c:\\test.csv -NoTypeInformation after my command. Not having to much luck here.<\/p>","upvoteCount":3,"answerCount":4,"datePublished":"2019-06-14T00:24:51.000Z","author":{"@type":"Person","name":"FrenchToast","url":"https://community.spiceworks.com/u/FrenchToast"},"acceptedAnswer":{"@type":"Answer","text":" What have you tried?<\/p>\n maybe like so<\/p>\n Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$.EmailAddresses |Where-Object {$<\/em>.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}}<\/p>\n Not familiar with looping arrays and how to export the result to powershell.<\/p>\n I’m more familiar with returning information that I need from exchange and AD and just being able to Export-CSV c:\\test.csv -NoTypeInformation after my command. Not having to much luck here.<\/p>","upvoteCount":3,"datePublished":"2019-06-14T00:24:51.000Z","url":"https://community.spiceworks.com/t/how-to-export-this-script-to-csv/716411/1","author":{"@type":"Person","name":"FrenchToast","url":"https://community.spiceworks.com/u/FrenchToast"}},{"@type":"Answer","text":" If you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>\n
$result = Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} \n\n$result | export-csv \"c:\\result.csv\" -NoTypeInformation\n<\/code><\/pre>","upvoteCount":3,"datePublished":"2019-06-14T00:33:06.000Z","url":"https://community.spiceworks.com/t/how-to-export-this-script-to-csv/716411/3","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},"suggestedAnswer":[{"@type":"Answer","text":"