The script enables a remote mailbox for a user.
In the script, the $remoteRoutingAddressTemplate variable specifies a template for the Remote Routing Address which will be applied to the remote mailbox. You can use value references in the template (e.g. %username%)
PowerShell
$remoteRoutingAddressTemplate = "%username%@mycompany.mail.onmicrosoft.com" # TODO: modify me
$Context.TargetObject.EnableRemoteMailbox($remoteRoutingAddressTemplate)
Hello,
What script are you using, For Adaxes 2015 and earlier or For Adaxes 2016 and later? How exactly do you execute the script? Do you face any error messages? If you do, please, provide us with screenshots. Screenshots of the workflow setup will be very helpful.
Also, it is not required to use scripts to enable remote mailboxes, it can be done automatically when a Microsoft 365 license is assigned to a user. For details, have a look at the following help article: https://www.adaxes.com/help/?HowDoI.PerformExchangeTasks.ConfigureEnablingDisablingOfRemoteMailboxes.html.