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
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
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
This type of request is what paid consultants provide. 8^}
Are you sure you should be doing this with PS vs Exchange email policies?
You really need to show what you've tried and where you are having issues. Otherwise you are asking us to set up an environment like what you have and produce what you are asking. Once you show your work, we can dig into where we can help you.
Now, if you are a PS person, then please the free video training on the topic, on MS Virtual Academy, MS Channel9, and YouTube, and of course there are paid for options. You can also, use the many freely available eBooks on this site and elsewhere. Lastly, you can let Windows write code for you dynamically. Use the ADAC and click thru one or two users to accomplish the steps you are showing, and tweak that to get closer.
Step-By-Step: Utilizing PowerShell History Viewer in Windows Server 2012 R2https://blogs.technet.microsoft.com/canitpro/2015/03/04/step-by-step-utilizing-powershell-history-viewer-in-windows-server-2012-r2
Use AD Administrative Center to Create PowerShell Commandshttps://www.petri.com/use-active-directory-administrative-center-create-powershell-commands
Lastly, this is a question that has many articles all over the web on how to do this, though not exactly as you are asking for, but will get you closer and then you can tweak from there.
Powershell script for changing Primary Email address of all usershttps://social.technet.microsoft.com/Forums/en-US/adbf06e6-9336-4fe4-98d9-43ade47d5230/powershell-script-for-changing-primary-email-address-of-all-users
Powershell for replacing primary email address and adding current primary to alias email addresseshttps://techcommunity.microsoft.com/t5/Office-365/Powershell-for-replacing-primary-email-address-and-adding/td-p/197844