0 votes

Can Adaxes verify the email address and if it existings add a number?

I am testing what happens if duplicate accounts exist. I get this error if trying to create an account with duplicate information.

Softerra.Adaxes.BackgroundThreadException: Exchange Edge PowerShell API: Failed to execute the following operation: Enable remote mailbox for 'Skywalker, Luke (site.com\users)' ---> System.Management.Automation.RemoteException: The proxy address "smtp:skywall@tenant.mail.onmicrosoft.com" is already being used by the proxy addresses or LegacyExchangeDN of "site.com/Change Management/Skywalker, Luke". Please choose another proxy address. at #Dh.#Jh.#l.#5w.#VZc(RunspacePool runspacePool, PSCommand psCommand, String[]& warnings) at #Dh.#Jh.#l.#5w.Execute(RunspacePool runspacePool, #Gh command) at #ik.#Lk.Execute(#Gh command) at #ik.#Ik.#VZc(#Gh command, #uy context) at #ik.#Fk.#VZc(#Gh command, #uy context) at #ik.#Fk.#XOc(#mn operation) at #9m.#nn.Execute() --- End of inner exception stack trace ---

by (790 points)


The error occurs because the remote routing address that is used to create a remote mailbox is already reserved. For us to provide you with a solution, please, post here or send us (support[at]adaxes.com) the template you currently have configured for remote routing addresses. If the template is configured for your Microsoft 365 tenant in Adaxes, you can check it using the script from section Viewing Current Settings of the following help article: https://www.adaxes.com/help/?HowDoI.PerformExchangeTasks.ConfigureEnablingDisablingOfRemoteMailboxes.html.


I recently followed the instructions listd in the URL above.


$tenantName = "Company" # TODO Modify me
$remoteRoutingAddressTemplate = "%lastname:lower,6%%firstname:lower,1%@cp0.mail.onmicrosoft.com" # TODO Modify me

# Bind to Adaxes service
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")

# Prompt for credentials of a service administrator
$credential = Get-Credential

# Bind to the configuration container
$configurationContainerPath = $admService.Backend.GetConfigurationContainerPath("CloudServicesO365")
$configurationContainer = $admService.OpenObject($configurationContainerPath, $credential.UserName,`
    $credential.GetNetworkCredential().Password, 0)

# Get tenant
$tenant = $configurationContainer.GetObject("adm-O365Tenant", "CN=$tenantName")

# Update parameter
$tenant.RemoteMailboxesRemoteRoutingAddress = $remoteRoutingAddressTemplate

# Save changes


Thank you for specifying. To achieve the desired, you can do the following:

  1. Use a specific property to store the suffix (%lastname:lower,6%%firstname:lower,1%) for the remote routing address via a Property Pattern. For example, you can use one of Adaxes custom text attributes (e.g. CustomAttributeText1).
  2. Update the remote routing address template to use the property. It should be done using the script you provided with the $remoteRoutingAddressTemplate variable specified like the following:
     $remoteRoutingAddressTemplate = "%adm-CustomAttributeText1%@cp0.mail.onmicrosoft.com" # TODO Modify me
  3. Use a Business Rule triggering Before creating a user that will execute a script to check whether the suffix stored in the property is already in use for an email address ending with cp0.mail.onmicrosoft.com. If it is, a digit will be added to the property value and the new value will then be used for the remote routing address when creating a remote mailbox.

Does the approach meet your needs?

Please log in or register to answer this question.

Related questions

0 votes
1 answer

Is it possible to connect to the Microsoft 365 Security & Compliance center through a PowerShell script? We are trying to configure users that belong to a ... department for a retention policy through the use of the Set-RetentionCompliancePolicy command.

asked Jan 3 by scoutcor (100 points)
0 votes
1 answer

Changing the "Forgot your password?" text.

asked Mar 10, 2020 by msylvester (60 points)
0 votes
1 answer

Hi: I am trying to create a business rule that will stop a value change based on the existing value. For example, if the telephonenumber is 1234 for a group and has to ... the value it uses is the incoming value of the change, not the existing value. Thanks!

asked Jun 3 by crobitaille (20 points)
0 votes
1 answer

I'm in the process of creating a Web interface for requesting IT accounts. Upon submission, I want to run a Powershell script that will create an item in a Sharepoint task list.

asked May 14, 2021 by sandramnc (820 points)
0 votes
1 answer

We have a single AD domain that also matches our primary email domain (e.g. @primarydomain.com), but we also have multiple company specific email domains (e.g. @companydomain. ... like to also link the companydomain.com to the user's company value set in AD.

asked Apr 29, 2020 by JacquesKruger (20 points)
2,801 questions
2,535 answers
61,639 users