Setting proxy addresses via PowerShell

I have some groups that I have converted from "Security" to "Distribution". I am trying to set proxyAddresses via PowerShell - Quest.  If I set one address, it does not get set to primary.  Do I need to specify multiple addresses and how do I do that?  I don't want to do this from a file....I am using existing attributes to populate the data.
get-qadgroup -searchRoot "OU=mydomain,dc=abc,dc=com" -ldapfilter "(!(mailNickname=*))" | set-Qadgroup -objectAttributes {@{mail=$_.sAmAccountName + "@mydomain.com";proxyAddresses=$_.sAmAccountName + 
"@mydomain.com";mailnickName=$_.samAccountName;msExchRecipientDisplayType="1";msExchPoliciesIncluded="{3555A8E0-A050-4347-91AE-2F1447F2105F},{26491CFC-9E50-4857-861B-0CB8DF22B5D7}";legacyExchangeDN="/O=MyDomain/OU=Email/cn=Recipients/cn=" + $_.sAmAccountName;msExchALObjectVersion="24"}}

Open in new window

sanderson321Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wonko_the_SaneCommented:
Without looking at this in detail:
You will have to add "SMTP:" in front of the actual address. Uppercase "SMTP:" for the primary one, lowercase "smtp:" for all secondary ones.
Also set the "mail" attribute to match the primary address, otherwise it won't work right.
0
Wonko_the_SaneCommented:
Also, make sure you mail-enable the groups, just converting them to distribution is NOT sufficient. Sorry if this is obvious.
0
sanderson321Author Commented:
I have tried using the SMTP prefix.  It adds this to the proxyAddresses attribute, but does not set it to primary even when all in upper case.  Yes, I know about mail-enabling.  
0
INTRODUCING: WatchGuard's New MFA Solution

WatchGuard is proud to announce the launch of AuthPoint, a powerful, yet simple, Cloud-based MFA service designed to eliminate the vulnerabilities that put your data, systems, and users at risk.

Wonko_the_SaneCommented:
So even when there is only one uppercase SMTP: entry this is not the primary SMTP address as displayed in the console? Are you sure? Did you check with a LDAP tool  to make sure this attribute is really set correctly?

You need smtp: either way, so the script above will not work.
0
sanderson321Author Commented:
Yes, I am looking at it in ADSI edit....I can see the value.  Thanks.
0
Wonko_the_SaneCommented:
can you post all the contents of your proxyaddresses and mail attributes here?
0
Satya PathakLead Technical ConsultantCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sanderson321Author Commented:
ok
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.