Trying to set the primary proxy when doing a name change on an email address.

by (1.2k points)

1 Answer

by (310k points)
–1 vote

Hello,

There is no need to use scripts. It can be done using a business rule triggering After renaming a user and built-in action, Modify Exchange properties. The following tutorial will be helpful: https://www.adaxes.com/help/AutomateExchangeMailboxConfiguration.

by (1.2k points)
0

We don't let addaxes update Azure like that. We set the settings in AD and let the oneway sync update Azure. Also, I need to remove any spaces in the the email address due to a user having a space in their name like Del Rio for example. Is there a way to set up a buisiness rule to remove spaces from an email address or proxy when I set it?

by (310k points)
0

Hello,

We don't let addaxes update Azure like that.

Adaxes is aware of the way hybrid Exchange works. The action works accordignly.

I need to remove any spaces in the the email address due to a user having a space in their name like Del Rio for example.

In this case, it is easier to directly do the whole thing in a script like below. It will take the required template, remove spaces and add it as new address. In the script:

  • $newAddressTemplate - Specifies the template for the address to add. You can use value references in the template. They will resolve into the corresponding property values of the target object.
  • $setAsPrimary - Specifies whether to set the new address as primary.
$newAddressTemplate = "%firstname%%lastname%@example.com" # TODO: modify me
$setAsPrimary = $True

# Create an instance of the 'AdmExchangeMailboxParameters' class
$mailboxParams = New-Object "Softerra.Adaxes.Adsi.Exchange.AdmExchangeMailboxParameters"

# Automatically update e-mail addresses based on e-mail address policy
$mailboxParams.EmailAddressPolicyEnabled = $false

$emailAddresses = $mailboxParams.EmailAddresses
$emailAddresses.OverrideOldValues = $false

# Create a new e-mail address
$emailAddress = $emailAddresses.CreateAddress("ADM_EXCHANGE_ADDRTYPE_SMTP", $null)
$emailAddress.Address = $newAddressTemplate.Replace(" ","")
$emailAddress.IsPrimary = $setAsPrimary

# Add the new e-mail address to the existing list
$emailAddresses.Add("ADS_PROPERTY_APPEND", $emailAddress)
$mailboxParams.EmailAddresses = $emailAddresses

# Save changes
$user = $Context.BindToObjectByDNEx("%distinguishedName%", $true)
$user.SetMailParameters($mailboxParams, "ADM_SET_EXCHANGE_PARAMS_FLAGS_RESOLVEVALUEREFERENCES")

Related questions

I don't understand how you would use this searcher function. Can you show me in this example? Import-Module ImportExcel #set up variables $currentTime = Get-Date ... $Context.BindToObjectByDN($NewU) $U.Put("adm-CustomAttributeBoolean6", $False) $U.SetInfo() }

asked Dec 14, 2023 by mightycabal (1.2k points)
0 votes
1 answer

I'd like to return the litigation hold attribute values if the script returns true. How can I do this?

asked 4 hours ago by GronTron (390 points)
0 votes
1 answer

Hello, We are currently rolling out a deployment for Windows Hello. For this, we have created a custom automation in Adaxes for users to have to reset their passwords on ... this group? Or, do you have another recommendation for getting this done? Thank you.

asked Mar 26 by aewilliams.324 (20 points)
0 votes
1 answer

I am trying to use a script to set a users AccountExpires attribute. However, I want there to be an approval sent and I am ... = $False $Context.SubmitForApproval($approvers, $managerOfRequestorIsApprover, $false, $false, $false) }

asked Dec 1, 2023 by mightycabal (1.2k points)
0 votes
1 answer