Update 2019
Starting with version 2019.1, Adaxes supports managing linked mailboxes. For details, have a look at the corresponding section of the related What’s New article: https://www.adaxes.com/info_whats-new_2019.1.htm#linked_mailboxes.
Original
Hello Arne,
Currently, Adaxes does not recognize linked mailboxes, thus you'll have to manage a user's account and his/her linked mailbox separately. Nevertheless, thanks for the suggestion. We've added this to our sandbox and will consider this request for one of the future releases.
What you can do currently with the help of Adaxes is create linked mailboxes for users in the account domains. For example, you can set up a Business Rule triggered after creating a new user in one of the account domains that will automatically created a linked mailbox for the user in the resource domain.
To create linked mailboxes, the Business Rule will need to run a PowerShell script. For information on how to automatically run scripts upon creating a new user, see the following tutorial: http://www.adaxes.com/tutorials_Automat ... ngUser.htm. On step 4 of the tutorial, you need to paste the below script. In the script, modify the following to match your environment:
- $resourceOuDN - specifies the Distinguished Name (DN) of the OU where linked mailboxes will be created;
- $exchangeServer - specifies the name of the Exchange Server to use for creation of linked mailboxes.
Import-Module Adaxes
$resourceOuDN = "OU=Resource Accounts,DC=domain,DC=com" # TODO: modify me
$exchangeServer = "ExchangeServer.domain.com" # TODO: modify me
# Get the name of the domain of the master account
$linkedDomainName = $Context.GetObjectDomain("%distinguishedName%")
# Get domain controlers in the domain of the master account
$linkedDomainControlers = Get-AdmComputer -LdapFilter "(&(objectCategory=Computer)(userAccountControl:1.2.840.113556.1.4.803:=8192))" `
-AdaxesService localhost -Server $linkedDomainName
# Get credentials for the resource domain
$exchangeAdminName = $Context.RunAs.UserName
$exchangeAdminPassword = ConvertTo-SecureString -AsPlainText -Force -String $Context.RunAs.Password
$credential = New-Object -TypeName System.Management.Automation.PSCredential($exchangeAdminName, $exchangeAdminPassword)
# Connect to Exchange Server in the resource domain and create linked mailbox
$session = New-PSSession –ConfigurationName Microsoft.Exchange –ConnectionUri "http://$exchangeServer/PowerShell/" –Credential $credential
Import-PSSession $session -AllowClobber -DisableNameChecking
$resourceDomainName = $Context.GetObjectDomain($resourceOuDN)
foreach ($linkedDomainControler in $linkedDomainControlers)
{
$Context.LogMessage($linkedDomainControler, "Information")
try
{
New-Mailbox -Name "%name%" -LinkedDomainController $linkedDomainControler.DNSHostName -LinkedMasterAccount "%distinguishedName%" `
-OrganizationalUnit $resourceOuDN -UserPrincipalName "%username%@$resourceDomainName" -ErrorAction Stop
}
catch
{
$Context.LogMessage($linkedDomainControler.DNSHostName + ":" + $_.Exception.Message, "Warning")
continue
}
break
}
Remove-PSSession $session