Hi,
I really hope someone can assist here as Exchange Shell is not my forte!
All I need to do is change a load of Aliases in Exchange using a .csv - The two columns in the .csv are Mail and Alias. I can change a single one using the command set-mailbox XXX.XXX@X .com -alias AB123.
As soon as I import the .csv either importing it separately or importing it in the same command line, everything errors horribly.
Does anyone have any idea what I can run to get this working? I've tried quite a few things:
Import-csv "c:\scripts\aliases.csv" | foreach {Get-MailContact -Identity $.Name | Set-MailContact -Alias $.Alias}
[PS] C:\Windows\system32>$csv= "C:\scripts\aliases.csv"
[PS] C:\Windows\system32>foreach ($mailbox in $csv) {get-mailbox -identity $mailbox.Mail | set-mailbox -alias $mailbox.Alias}
ANY help here would be greatly appreciated!