A newbie here, please forgive me. I’ve been trying all day to no avail.
I’m trying to alter the Display Names in bulk for all users listed as a MailContact in the Exchange Admin Center by referring to the users PrimarySmtpAddress within ExchangeOnline Powershell. The Display Names have to include the text “(External Contact)” at the end of each name which is altered in the csv file.
There are only two columns in my csv file: PrimarySmtpAddress and NewDisplayName.
I may be way off course here because I’m receiving a null identity error along with other issues like not adding a enumeration value (ex.SilentlyContinue,Stop,Continue).
Any help is much appreciated.
Here’s the code I’m trying to work with at the moment..
Get-MailContact -Identity
$csv = Import-csv -path "C:Usersmyaccountheretest1.csv”
foreach($PrimarySmtpAddress in $csv)
{Set-MailContact $PrimarySmtpAddress.PrimarySmtpAddress -DisplayName $PrimarySmtpAddress.NewDisplayName}
Tina Duong is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.