I'm being tasked with creating a script that polls AD for specific information and then creates an appropriate email address based on that information. Please allow me to give you a bit of a rundown.
My company has 5 email domains that we have. All 5 are allowed through Exchange, but we only use one right now. Currently, everyone is setup with the default company.com email address. We have several different brands that we'd like to segment our users to in an effort to increase email deliverability to help keep our corporate email unaffected by IP reputation when marketing decides to release mass emails.
I manage a 7 server Exchange 2010 DAG (3 production, 3 DR, 1 3-day Lag). I'm fairly decent at PowerShell and pretty good at finding the code pieces I need, so I'm not looking for an entire script, but I'm having troubles with this certain pieces.
What the business wants to do is have a script that reads an attribute in AD, then based on that attribute, assigns it to the correct brand. So, for instance. If AD user has "Marketing" attribute, they would get marketing.com email address as their primary reply-to address while still retaining their company.com email address as a secondary. If an AD user has "building products" as their attribute, building.com would be their reply-to email address, etc.
I can get PowerShell to poll AD for an attribute. I can get it to create an email. I'm having troubles figure out how to get it to select one of the other domain names and not the default company.com email address.
Any insight would be greatly appreciated.