Configuring Lync Server 2013 to be a partner Application for Exchange 2013

Ahmed FouadSystem Administrator
I’m an IT professional with around 7 years of experience in Unified Communication, Collaborations and Virtualization technology, during this
Published:
I just want to share my experience while configuring Lync server 2013 to be a partner Application for exchange 2013.

As mentioned on https://technet.microsoft.com/en-us/library/jj688151.aspx you need to run Configure-EnterprisePartnerApplication.ps1 script that ships with Exchange 2013. But when I tried to run the script as described on the technet article, I found it always fails with "the accepted domain is not valid". I have checked my accepted domains many times and i found that there's no issues with my configured accepted domain.

So I started to review the script to find the issue and I found that the script was configured as below
$acceptedDomains = Get-AcceptedDomain ;
                      
                        if ($acceptedDomains -eq $null)
                        {
                          WriteError ("There is no accepted domain so user can not be created.")
                        }
                        
                        $acceptedDomain = $acceptedDomains[0].Name;
                      
                        if($UseDomainController -eq $true)
                        {
                          $user = New-MailUser -Name $username -DomainController $DomainController -ExternalEmailAddress $username@$acceptedDomain;
                      set-mailuser -Identity $user.Identity -HiddenFromAddressListsEnabled $true -DomainController $DomainController
                        }
                        else
                        {
                          $user = New-MailUser -Name $username -ExternalEmailAddress $username@$acceptedDomain;

Open in new window


which is totally wrong.

First, it makes $AcceptedDomain variable to equal the Name of the accepted domain. Not all customers configure the name of the Accepted Domain to be the Domain Name.

Second, it makes $AcceptedDomain variable to equal the name of the first Accepted Domain. The first domain may be not the default Accepted Domain.

So I have configured the script as below
$acceptedDomains = Get-AcceptedDomain | ? {$_.Default -eq "True"}  ;
                      
                        if ($acceptedDomains -eq $null)
                        {
                          WriteError ("There is no accepted domain so user can not be created.")
                        }
                        
                        $acceptedDomain = $acceptedDomains.DomainName;
                      
                        if($UseDomainController -eq $true)
                        {
                          $user = New-MailUser -Name $username -DomainController $DomainController -ExternalEmailAddress $username@$acceptedDomain;
                      set-mailuser -Identity $user.Identity -HiddenFromAddressListsEnabled $true -DomainController $DomainController
                        }
                        else
                        {
                          $user = New-MailUser -Name $username -ExternalEmailAddress $username@$acceptedDomain;
                      set-mailuser -Identity $user.Identity -HiddenFromAddressListsEnabled $true; 
                        }

Open in new window

1
1,177 Views
Ahmed FouadSystem Administrator
I’m an IT professional with around 7 years of experience in Unified Communication, Collaborations and Virtualization technology, during this

Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.