Hi Rune,
sure, just exchange Get-User by Get-Mailbox .. you can filter for -OrganizationalUnit too, but then can use the .Alias property for the syntax above.
Alex
Bulk add extra smtp with prefix
We are still on prem exchange 2016.
I need to bulk add one extra smtp with prefix like something.alias@keyman .com
I would also point this to on OU in AD
My default email address policy ia pointing to all exchange users, so I would like to avoid that.
I looked into:
Get-User -OrganizationalUnit "OU" | % { Set-Mailbox $.UserPrincipalName -EmailAddresses @{add="$("something").$($.FirstName).$($_.LastName)@keyman .com"}}
But we are using æ,ø and å here so that was not the way.
I tried to replace ($.FirstName).$($.LastName) with ($_.alias), but since that is an exchange attribute, no success.
Anyone got input to me? Is there a way to get-mailbox selected from OrganizationalUnit and return with something.alias@keyman .com?
Thank you in advance
-
AlexC 246 Reputation points
2021-06-04T11:55:41.007+00:00