Jan 27 2021 06:57 PM
I am trying to export a list of users email address in array format..
say I have 10 users in a CSV file (displayname)
Need a command to export their emailaddresses in array type
example:
colum1 should have name
column2 should have 1 smtpaddress
colum 3 should have the other smtpaddress
can someone help pls
Jan 27 2021 11:47 PM
Use PrimarySmtpAddress for the second column, and something like ($_.EmailAddresses -join ";") for the third. The syntax will depend on whether you are running this against EMS or Remote Exchange PowerShell.
Jan 28 2021 12:02 AM - edited Jan 28 2021 12:04 AM
$Myusers=@("Firstname LastName","FirstName1 LastName1")
$Myusers.foreach{Get-ADUser -Properties mail,proxyAddresses -Filter "displayname -like '$_'" | ft mail,proxyAddresses }
Use this method if you don't have Exchange Management Shell or want to get the information via Active Directory.
Jan 28 2021 12:17 AM
@Vasil Michev I am running this in Remote exchange powershell.