need assistance with a powershell script for adding additional email alias

hello, can someone help me modify the following script to work on a non-exchange server. [we are in dirsync mode with office 365 and have removed Exchange on-premise.
I need to modify this to key on the proxyAddresses attribute rather than emailAddresses so I can run this on a domain controller [not an exchange server]

Import-Csv alias-add-pipe.csv | % {
$user = Get-user $_.SMTP 
$user.emailAddresses += $_.newsmtp
Set-Mailbox $user -emailAddresses $user.emailAddresses

Open in new window

Who is Participating?
Will SzymkowskiSenior Solution ArchitectCommented:
siber1Author Commented:
can someone assist me with modifying the code I submitted to meet these requirements.

thx in advance.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.