sanderson321
asked on
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"}}
Also, make sure you mail-enable the groups, just converting them to distribution is NOT sufficient. Sorry if this is obvious.
ASKER
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.
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.
You need smtp: either way, so the script above will not work.
ASKER
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok
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.