Configure a hybrid environment in Skype for Business Server 2015

Skype for Business Server 2015

마지막으로 수정된 항목: 2017-01-10

Summary: Configure 비즈니스용 Skype 서버 2015 in a hybrid environment.

In a hybrid configuration, some of your users are homed on an on-premises installation of 비즈니스용 Skype 서버 2015 while other users are homed on the Office 365 version of 비즈니스용 Skype 서버. In order to configure server-to-server authentication in a hybrid environment, you must first configure your on-premises installation of 비즈니스용 Skype 서버 2015 to trust the Office 365 authorization server. The initial step in this process can be carried out by running the following 비즈니스용 Skype 서버 관리 쉘 script:

$TenantID = (Get-CsTenant -Filter {DisplayName -eq ""}).TenantId

$sts = Get-CsOAuthServer microsoft.sts -ErrorAction SilentlyContinue
   if ($sts -eq $null)
         New-CsOAuthServer microsoft.sts -MetadataUrl "$TenantId/metadata/json/1"
         if ($sts.MetadataUrl -ne  "$TenantId/metadata/json/1")
               Remove-CsOAuthServer microsoft.sts
               New-CsOAuthServer microsoft.sts -MetadataUrl "$TenantId/metadata/json/1"

$exch = Get-CsPartnerApplication -ErrorAction SilentlyContinue
if ($exch -eq $null)
      New-CsPartnerApplication -Identity -ApplicationIdentifier 00000002-0000-0ff1-ce00-000000000000 -ApplicationTrustLevel Full -UseOAuthServer
       if ($exch.ApplicationIdentifier -ne "00000002-0000-0ff1-ce00-000000000000")
             New-CsPartnerApplication -Identity -ApplicationIdentifier 00000002-0000-0ff1-ce00-000000000000 -ApplicationTrustLevel Full -UseOAuthServer 
             Set-CsPartnerApplication -Identity -ApplicationTrustLevel Full -UseOAuthServer

Set-CsOAuthConfiguration -ServiceName 00000004-0000-0ff1-ce00-000000000000

Keep in mind that the realm name for a tenant is typically different than the organization name; in fact, the realm name is almost always the same as the tenant ID. Because of that, the first line in the script is used to return the value of the TenantId property for the specified tenant (in this case, and then assign that name to the variable $TenantId:

$TenantID = (Get-CsTenant -DisplayName "").TenantId

After the script completes, you must then configure a trust relationship between 비즈니스용 Skype 서버 2015 and the authorization server, and a second trust relationship between Exchange 2013 and the authorization server. This can only be done by using the Microsoft Online Services cmdlets.

If you have not installed the Microsoft Online Services cmdlets, you will need to do two things before proceeding. First, download and install the 64-bit version of the Microsoft Online Services Sign-in Assistant. After installation is complete, download and install the 64-bit version of the Microsoft Online Services Module for Windows PowerShell. Detailed information for installing and using the Microsoft Online Services Module can be found on the Office 365 web site. These instructions will also tell you how to configure single sign-on, federation, and synchronization between Office 365 and Active Directory.
If you have not installed these cmdlets your script will fail because the Get-CsTenant cmdlet will not be available.

After you have configured Office 365, and after you have created Office 365 service principals for 비즈니스용 Skype 서버 2015 and Exchange 2013, you will then need to register your credentials with these service principals. In order to do this, you must first obtain an X.509 Base64 saved as a .CER file. This certificate will then be applied to the Office 365 service principals.

When you have obtained the X.509 certificate, start the Microsoft Online Services Module (click Start, click All Programs, click Microsoft Online Services, and then click Microsoft Online Services Module for Windows PowerShell). After the Services Module opens, type the following to import the Microsoft Online Windows PowerShell module containing the cmdlets that can be used to manage service principals:

Import-Module MSOnlineExtended

When the module has been imported, type the following command and then press ENTER in order to connect to Office 365:


After you press ENTER, a credentials dialog box will appear. Enter your Office 365 user name and password in the dialog box, and then click OK.

As soon as you are connected to Office 365, you can then run the following command in order to return information about your service principals:


You should get back information similar to this for all your service principals:

ExtensionData        : System.Runtime.Serialization.ExtensionDataObject
AccountEnabled       : True
Addresses            : {}
AppPrincipalId       : 00000004-0000-0ff1-ce00-000000000000
DisplayName          : Skype for Business Server
ObjectId             : aada5fbd-c0ae-442a-8c0b-36fec40602e2
ServicePrincipalName : SkypeForBusinessServer/
TrustedForDelegation : True

The next step is to import, encode, and assign the X.509 certificate. To import and encode the certificate, use the following Windows PowerShell commands, being sure to specify the complete file path to your .CER file when you call the Import method:

$certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate
$binaryValue = $certificate.GetRawCertData()
$credentialsValue = [System.Convert]::ToBase64String($binaryValue)

After the certificate has been imported and encoded, you can then assign the certificate to your Office 365 service principals. To do that, first use the Get-MsolServicePrincipal to retrieve the value of the AppPrincipalId property for both the 비즈니스용 Skype 서버 and the Microsoft Exchange service principals; the value of the AppPrincipalId property will be used to identify the service principal being assigned the certificate. With the AppPrincipalId property value for 비즈니스용 Skype 서버 2015 in hand, use the following command to assign the certificate to the Office 365 version of 비즈니스용 Skype 서버:

New-MsolServicePrincipalCredential -AppPrincipalId 00000004-0000-0ff1-ce00-000000000000 -Type Asymmetric -Usage Verify -Value $credentialsValue 

You should then repeat the command, this time using the AppPrincipalId property value for Exchange 2013.

If you later need to delete that certificate, you can do so by first retrieving the KeyId for the certificate:

Get-MsolServicePrincipalCredential -AppPrincipalId 00000004-0000-0ff1-ce00-000000000000

That command will return data like this one:

Type      : Asymmetric
Value     : 
KeyId     : bc2795f3-2387-4543-a95d-f92c85c7a1b0
StartDate : 6/1/2012 8:00:00 AM
EndDate   : 5/31/2013 8:00:00 AM
Usage     : Verify

You can then delete the certificate by using a command similar to this:

Remove-MsolServicePrincipalCredential -AppPrincipalId 00000004-0000-0ff1-ce00-000000000000 -KeyId bc2795f3-2387-4543-a95d-f92c85c7a1b0

In addition to assigning a certificate, you must also configure the Exchange Online Service Principal and configure your on-premises version of 비즈니스용 Skype 서버 2015 external Web services URLs as an Office 365 service principal. That can be done by carrying out the following two commands.

In the following example, is the external Web services URL for the Skype for Business Server pool. You should repeat these steps to add all the external Web services URLs in the deployment.

Set-MSOLServicePrincipal -AppPrincipalID 00000002-0000-0ff1-ce00-000000000000 -AccountEnabled $true

$lyncSP = Get-MSOLServicePrincipal -AppPrincipalID 00000004-0000-0ff1-ce00-000000000000
Set-MSOLServicePrincipal -AppPrincipalID 00000004-0000-0ff1-ce00-000000000000 -ServicePrincipalNames $lyncSP.ServicePrincipalNames