Configuring server-to-server authentication
Earlier in the chapter, I said that I hope you like PowerShell. Well, here is why. Unfortunately, we don't have the space here to go through every command in detail. However, open up PowerShell and enter each line, pressing enter after each, and if all goes well you will be ready to start configuring hybrid search. You will need to change the following variables to match your environment:
$spcn="*.office365lab.co.uk"
$spsite=Get-Spsite http://sharepoint
$cerPath = "c:\Office365LabSTS.cer"
$pfxPath = "c:\Office365LabSTSCert.pfx"
$pfxPass = "DJ989we..wefds908*"
Once you have updated the variables, you are ready to run the script:
//IMPORT MODULES
Add-PSSnapin Microsoft.SharePoint.PowerShell
Import-Module Microsoft.PowerShell.Utility
Import-Module MSOnline -force
Import-Module MSOnlineExtended -force
Import-Module Microsoft.Online.SharePoint.PowerShell -force
enable-psremoting
//CONNECT TO TENANT
new-pssession...