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 + "";proxyAddresses=$_.sAmAccountName + 
"";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

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.

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.
Also, make sure you mail-enable the groups, just converting them to distribution is NOT sufficient. Sorry if this is obvious.
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.  
Price Your IT Services for Profit

Managed service contracts are great - when they're making you money. Yes, you’re getting paid monthly, but is it actually profitable? Learn to calculate your hourly overhead burden so you can master your IT services pricing strategy.

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.
sanderson321Author Commented:
Yes, I am looking at it in ADSI edit....I can see the value.  Thanks.
can you post all the contents of your proxyaddresses and mail attributes here?
Satya PathakLead Technical ConsultantCommented:

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:
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

From novice to tech pro — start learning today.