0 votes

I'm using the following code to add an email address to a mailbox (which works). But how can I mark the address as reply address?:


$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("[Server]")

# Bind to user object
$userDN = "[DN]"
$user = $admService.OpenObject("Adaxes://$userDN", $NULL, $NULL, 0)

# Create an instance of the AdmExchangeMailContactParameters class
#set EmailAddressPolicyEnabled to False before making changes
$userParams = New-Object "Softerra.Adaxes.Adsi.Exchange.AdmExchangeMailboxParameters"
$userParams.EmailAddressPolicyEnabled = $False
#$user.SetMailParameters($userParams, "ADM_SET_EXCHANGE_PARAMS_FLAGS_NONE")

# Add a new modification
$emailAddresses = $userParams.EmailAddresses
$emailAddresses.OverrideOldValues = $False
$newAddress = $emailAddresses.CreateAddress("ADM_EXCHANGE_ADDRTYPE_SMTP", $null)
$newAddress.Address = "[account]"
$emailAddresses.Add("ADS_PROPERTY_APPEND", $newAddress)
$userParams.EmailAddresses = $emailAddresses
$mailbox = $admService.OpenObject("Adaxes://$userDN", $NULL, $NULL, 0)

by (780 points)

1 Answer

0 votes
by (780 points)

fixed it by using: $newAddress.IsPrimary = $true

Related questions

0 votes
1 answer

Since 2020.1 added the friendly From name for emails, I would like to ask for the ability to specify a Reply-to address. This would be very helpful to have ... develing deeper into the System.Net.Mail.MailMessage class to add a replyto address to message.

asked Jul 15, 2020 by polley (1.2k points)
0 votes
1 answer

Hello, I think I might have found a regression. Starting 2014.1 it is impossible to change the reply address for a user having an Exchange 2003 mailbox. The button "Set ... related to my authorizations; I did test various configuration (admin, ...). Regards,

asked May 2, 2014 by Pierre (750 points)
0 votes
1 answer

When creating a hybrid user mailbox with a Business Rule, after user creation, the remote routing address of the mailbox is set to the users email alias. How do I set it to the 365 address username@ourdomain.mail.onmicrosoft.com

asked Apr 13, 2022 by john.harding (70 points)
+1 vote
1 answer

I'm trying to enable SSO using SAML with AzureAD as the IDP. I'm struggling to get it to work, we use a BIG-IP as our loadbalancer which handles the SSL offloading. ... offloading or am I forced to remove the SSL offloading and do it on the server itself?

asked May 12, 2020 by Quinten (100 points)
0 votes
1 answer

Having a little issue trying to figure out how to insert information into an HTML template. We have an HTML template that is inserted into a disabled ... Scheduled -EndTime 1/1/2050 -ExternalMessage "$AutoReplyMessage" Remove-PSSession -Session $session

asked Feb 17, 2013 by ABrown (70 points)
3,071 questions
2,784 answers
434,341 users