Need help Creating Aliases, Switching Alias as primary Exchange Email powershell

Hello folks, I need a script to create mass aliases and then make it a primary email + some extra later in the post

We have big list of users @domainA.com we now have to create aliases of the same name@domainB.com for each user

example:

user1@domainA.com get alias as user1@domainB.com and then this domainB.com is set as his primary email address others are aliases

now once this is done we will have some users among all of these who will need an email change @domainB.com so this means that some users will get a 2nd alias and then this will be made as primary, yes to make it simpler we are trying to do it in 2 steps :) so some people will have 2 aliases on the some domain

example:

user1@domainA.com get alias as user1@domainB.com

but we would now change his name from user1@domainB.com to user.name@domainB.com

Please let me know if you would need more details on this, this is what we would need, there are more than a thousand users atm and doing it manually would be a pain :) Thanks

Parents
No Data
Reply Children
No Data