Bulk add extra smtp with prefix

Rune Oksnes 21 Reputation points
2021-06-04T08:13:11.767+00:00

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

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,855 questions
{count} votes

Accepted answer
  1. AlexC 246 Reputation points
    2021-06-04T11:55:41.007+00:00

    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


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.