简体   繁体   中英

PowerShell: add new Aliases to AD Groups (proxyAddresses) based on the existing ones

Hello and hope Everyone is doing alright.

I've been requested to add new proxy addresses to distribution groups in AD for thousands of DGs and make the new one the primary SMTP as follows;

**Dist. Group example:**
DG Name: TestDistGroup
SMTP:testdistgroup@domain1.com
smtp:tdg@domain1.com
smtp:testdg@domain1.com

I have to add to the list of proxyAddresses the same aliases as above but with a different domain (domain2.com), keeping the existing ones and switching the current primary (SMTP:testdistgroup@domain1.com) to (SMTP:testdistgroup@domain2.com).

Any idea what is the best way to achieve this with PowerShell??

I hope I could have explained myself good enough. Thank you in advance for any coming help

I as able to accomplish this myself and the script can be found at; https://gist.github.com/heyvoon/a6645bf8d9e1a5f5681aee05c24dbf9c

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM