<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Dirsync on Janik von Rotz</title>
    <link>https://janikvonrotz.ch/tags/dirsync/</link>
    <description>Recent content in Dirsync on Janik von Rotz</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Wed, 14 May 2014 07:03:29 +0000</lastBuildDate>
    <atom:link href="https://janikvonrotz.ch/tags/dirsync/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Configure hybrid search results from SharePoint Online in SharePoint on-premise</title>
      <link>https://janikvonrotz.ch/2014/05/14/configure-hybrid-search-results-from-sharepoint-online-in-sharepoint-on-premise/</link>
      <pubDate>Wed, 14 May 2014 07:03:29 +0000</pubDate>
      <guid>https://janikvonrotz.ch/2014/05/14/configure-hybrid-search-results-from-sharepoint-online-in-sharepoint-on-premise/</guid>
      <description>&lt;p&gt;&lt;em&gt;This post of is part of my &lt;a href=&#34;https://janikvonrotz.ch/projects/install-sharepoint-2013-three-tier-farm/&#34;&gt;Install SharePoint 2013 Three-tier Farm&lt;/a&gt; project.&lt;/em&gt;&#xA;&lt;em&gt;Get the latest version of this article here: &lt;a href=&#34;https://gist.github.com/10871110&#34;&gt;https://gist.github.com/10871110&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;introduction&#34;&gt;Introduction&lt;/h1&gt;&#xA;&lt;p&gt;In this post I&amp;rsquo;ll show you how to get search results from your SharePoint Online in your SharePoint 2013 on-premise search center.&#xA;&lt;img src=&#34;https://janikvonrotz.ch/wp-content/uploads/2014/04/SharePoint-Hybrid-Outbound-search.jpg&#34; alt=&#34;SharePoint Hybrid Outbound search&#34;&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;requirements&#34;&gt;Requirements&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;User synchronisation ActiveDirectory to Office 365 with DirSync&lt;/li&gt;&#xA;&lt;li&gt;DirSync password sync or ADFS SSO&lt;/li&gt;&#xA;&lt;li&gt;SharePoint Online&lt;/li&gt;&#xA;&lt;li&gt;SharePoint 2013 on-premise&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Enterprise Search service&lt;/li&gt;&#xA;&lt;li&gt;SharePoint Online Management Shell&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1 id=&#34;instructions&#34;&gt;Instructions&lt;/h1&gt;&#xA;&lt;p&gt;All configuration will be done either in the Search Administration of the Central Administration or in the PowerShell console of your on-premise SharePoint 2013 server.&lt;/p&gt;&#xA;&lt;h1 id=&#34;set-up-sever-to-server-trust&#34;&gt;Set up Sever to Server Trust&lt;/h1&gt;&#xA;&lt;h2 id=&#34;export-certificates&#34;&gt;Export certificates&lt;/h2&gt;&#xA;&lt;p&gt;To create a server to server trust we need two certificates.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;[certificate name].pfx&lt;/strong&gt;: In order to replace the STS certificate, the certificate is needed in Personal Information Exchange (PFX) format including the private key.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;[certificate name].cer&lt;/strong&gt;: In order to set up a trust with Office 365 and Windows Azure ACS, the certificate is needed in CER Base64 format.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;First launch the &lt;strong&gt;Internet Information Services (IIS) Manager&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select your &lt;strong&gt;SharePoint web server&lt;/strong&gt; and double-click &lt;strong&gt;Server Certificates&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;In the &lt;strong&gt;Actions&lt;/strong&gt; pane, click &lt;strong&gt;Create Self-Signed Certificate&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Enter a name for the certificate and save it with &lt;strong&gt;OK&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;To export the new certificate in the Pfx format select it and click &lt;strong&gt;Export&lt;/strong&gt; in the &lt;strong&gt;Actions&lt;/strong&gt; pane&lt;/li&gt;&#xA;&lt;li&gt;Fill the fields and click &lt;strong&gt;OK&lt;/strong&gt;&#xA;Export to: &lt;code&gt;C:\[certificate name].pfx&lt;/code&gt;&#xA;Password: &lt;code&gt;[password]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Also we need to export the certificate in the CER Base64 format. For that purpose make a &lt;strong&gt;right-click&lt;/strong&gt; on the certificate and click on &lt;strong&gt;View&amp;hellip;&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Click the &lt;strong&gt;Details&lt;/strong&gt; tab and then click &lt;strong&gt;Copy to File&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;On the Welcome to the Certificate Export Wizard page, click &lt;strong&gt;Next&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;On the Export Private Key page, click &lt;strong&gt;Next&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;On the Export File Format page, click &lt;strong&gt;Base-64 encoded X.509&lt;/strong&gt; (.CER), and then click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;As file name enter &lt;code&gt;C:\[certificate name].cer&lt;/code&gt; and then click &lt;strong&gt;Next&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Finish the export&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;import-the-new-sts-sharepoint-token-service-certificate&#34;&gt;Import the new STS (SharePoint Token Service) certificate&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s update the certificate on the STS. Configure and run the PowerShell script below on your SharePoint server.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;-not&lt;/span&gt; (Get-PSSnapin &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Microsoft.SharePoint.PowerShell&amp;#34;&lt;/span&gt; -ErrorAction SilentlyContinue)){Add-PSSnapin &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Microsoft.SharePoint.PowerShell&amp;#34;&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# set the cerficates paths and password&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$PfxCertPath = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;c:\[certificate name].pfx&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$PfxCertPassword = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;[password]&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$X64CertPath = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;c:\[certificate name].cer&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# get the encrypted pfx certificate object&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$PfxCert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $PfxCertPath, $PfxCertPassword, &lt;span style=&#34;color:#ae81ff&#34;&gt;20&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# import it&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Set-SPSecurityTokenServiceConfig -ImportSigningCertificate $PfxCert&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Type &lt;strong&gt;Yes&lt;/strong&gt; when prompted with the following message.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;You are about to change the signing certificate for the Security Token Service. Changing the certificate to an invalid, inaccessible or non-existent certificate will cause your SharePoint installation to stop functioning. Refer to the following article for instructions on how to change this certificate: &lt;a href=&#34;http://go.microsoft.com/fwlink/?LinkID=178475&#34;&gt;http://go.microsoft.com/fwlink/?LinkID=178475&lt;/a&gt;. Are you sure, you want to continue?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Restart IIS so STS picks up the new certificate.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;amp; iisreset&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;amp; net stop SPTimerV4&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;amp; net start SPTimerV4&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now validate the certificate replacement by running several PowerShell commands and compare their outputs.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# set the cerficates paths and password&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$PfxCertPath = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;c:\[certificate name].pfx&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$PfxCertPassword = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;[password]&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# get the encrypted pfx certificate object&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $PfxCertPath, $PfxCertPassword, &lt;span style=&#34;color:#ae81ff&#34;&gt;20&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# compare the output above with this output&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;(Get-SPSecurityTokenServiceConfig).LocalLoginProvider.SigningCertificate&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;establish-the-server-to-server-trust&#34;&gt;Establish the server to server trust&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;-not&lt;/span&gt; (Get-PSSnapin &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Microsoft.SharePoint.PowerShell&amp;#34;&lt;/span&gt; -ErrorAction SilentlyContinue)){Add-PSSnapin &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Microsoft.SharePoint.PowerShell&amp;#34;&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Import-Module MSOnline &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Import-Module MSOnlineExtended&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# set the cerficates paths and password&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$PfxCertPath = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;c:\[certificate name].pfx&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$PfxCertPassword = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;[password]&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$X64CertPath = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;c:\[certificate name].cer&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# set the onpremise domain that you added to Office 365&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$SPCN = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;sharepoint.domain.com&amp;#34;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# your onpremise SharePoint site url&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$SPSite=&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;http://sharepoint&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# don&amp;#39;t change this value&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$SPOAppID=&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;00000003-0000-0ff1-ce00-000000000000&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# get the encrypted pfx certificate object&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$PfxCert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $PfxCertPath, $PfxCertPassword, &lt;span style=&#34;color:#ae81ff&#34;&gt;20&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# get the raw data&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$PfxCertBin = $PfxCert.GetRawCertData()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# create a new certificate object&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$X64Cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# import the base 64 encoded certificate&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$X64Cert.Import($X64CertPath)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# get the raw data&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$X64CertBin = $X64Cert.GetRawCertData()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# save base 64 string in variable&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$CredValue = [&lt;span style=&#34;color:#66d9ef&#34;&gt;System.Convert&lt;/span&gt;]::ToBase64String($X64CertBin)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# connect to office 3656&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Connect-MsolService&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# register the on-premise STS as service principal in Office 365&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# add a new service principal&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;New-MsolServicePrincipalCredential -AppPrincipalId $SPOAppID -Type asymmetric -Usage Verify -Value $CredValue&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$MsolServicePrincipal = Get-MsolServicePrincipal -AppPrincipalId $SPOAppID&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$SPServicePrincipalNames = $MsolServicePrincipal.ServicePrincipalNames&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$SPServicePrincipalNames.Add(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$SPOAppID&lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt;$SPCN&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Set-MsolServicePrincipal -AppPrincipalId $SPOAppID -ServicePrincipalNames $SPServicePrincipalNames&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# get the online name identifier&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$MsolCompanyInformationID = (Get-MsolCompanyInformation).ObjectID&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$MsolServicePrincipalID = (Get-MsolServicePrincipal -ServicePrincipalName $SPOAppID).ObjectID&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$MsolNameIdentifier = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$MsolServicePrincipalID&lt;span style=&#34;color:#e6db74&#34;&gt;@&lt;/span&gt;$MsolCompanyInformationID&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# establish the trust from on-premise with ACS (Azure Control Service)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# add a new authenticatio realm&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$SPSite = Get-SPSite $SPSite&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$SPAppPrincipal = Register-SPAppPrincipal -site $SPSite.rootweb -nameIdentifier $MsolNameIdentifier -displayName &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;SharePoint Online&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Set-SPAuthenticationRealm -realm $MsolServicePrincipalID&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# register the ACS application proxy and token issuer&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;New-SPAzureAccessControlServiceApplicationProxy -Name &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;ACS&amp;#34;&lt;/span&gt; -MetadataServiceEndpointUri &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://accounts.accesscontrol.windows.net/metadata/json/1/&amp;#34;&lt;/span&gt; -DefaultProxyGroup&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;New-SPTrustedSecurityTokenIssuer -MetadataEndpoint &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://accounts.accesscontrol.windows.net/metadata/json/1/&amp;#34;&lt;/span&gt; -IsTrustBroker -Name &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;ACS&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id=&#34;add-a-new-result-source&#34;&gt;Add a new result source&lt;/h1&gt;&#xA;&lt;p&gt;To get search results from SharePoint Online we have to add a new result source. Run the following script in a PowerShell ISE session on your SharePoint 2013 on-premise server.&#xA;Don&amp;rsquo;t forget to update the settings region&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;-not&lt;/span&gt; (Get-PSSnapin &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Microsoft.SharePoint.PowerShell&amp;#34;&lt;/span&gt; -ErrorAction SilentlyContinue)){Add-PSSnapin &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Microsoft.SharePoint.PowerShell&amp;#34;&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# region settings &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$RemoteSharePointUrl = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;http://[example].sharepoint.com&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ResultSourceName = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;SharePoint Online&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$QueryTransform = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;{searchTerms}&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$Provier = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;SharePoint-Remoteanbieter&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# region settings end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$SPEnterpriseSearchServiceApplication = Get-SPEnterpriseSearchServiceApplication&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$FederationManager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager($SPEnterpriseSearchServiceApplication)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$SPEnterpriseSearchOwner = Get-SPEnterpriseSearchOwner -Level Ssa  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ResultSource = $FederationManager.GetSourceByName($ResultSourceName, $SPEnterpriseSearchOwner)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt;(!$ResultSource){&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Write-Host &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Result source does not exist. Creating...&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    $ResultSource = $FederationManager.CreateSource($SPEnterpriseSearchOwner)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ResultSource.Name = $ResultSourceName&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ResultSource.ProviderId = $FederationManager.ListProviders()[$Provier].Id&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ResultSource.ConnectionUrlTemplate = $RemoteSharePointUrl&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ResultSource.CreateQueryTransform($QueryTransform)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ResultSource.Commit()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;add-a-new-query-rule&#34;&gt;Add a new query rule&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;In the Search Administration click on &lt;strong&gt;Query Rules&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select &lt;strong&gt;Local SharePoint&lt;/strong&gt; as Result Source&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;strong&gt;New Query Rule&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Enter a Rule name f.g. Search results from SharePoint Online&lt;/li&gt;&#xA;&lt;li&gt;Expand the &lt;strong&gt;Context&lt;/strong&gt; section&lt;/li&gt;&#xA;&lt;li&gt;Under &lt;strong&gt;Query is performed on these sources&lt;/strong&gt; click on &lt;strong&gt;Add Source&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select your SharePoint Online result source&lt;/li&gt;&#xA;&lt;li&gt;In the &lt;strong&gt;Query Conditions&lt;/strong&gt; section click on &lt;strong&gt;Remove Condition&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;In the &lt;strong&gt;Actions&lt;/strong&gt; section click on &lt;strong&gt;Add Result Block&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;As &lt;strong&gt;title&lt;/strong&gt; enter &lt;strong&gt;Results for &amp;ldquo;{subjectTerms}&amp;rdquo; from SharePoint Online&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;In the &lt;strong&gt;Search this Source&lt;/strong&gt; dropdown select your SharePoint Online result source&lt;/li&gt;&#xA;&lt;li&gt;Select 3 in the &lt;strong&gt;Items&lt;/strong&gt; dropdown&lt;/li&gt;&#xA;&lt;li&gt;Expand the &lt;strong&gt;Settings&lt;/strong&gt; section and select &lt;strong&gt;&amp;ldquo;More&amp;rdquo; link goes to the following URL&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;In the box below enter this Url &lt;strong&gt;https://[example].sharepoint.com/search/pages/results.aspx?k={subjectTerms}&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select &lt;strong&gt;This block is always shown above core results&lt;/strong&gt; and click the OK button&lt;/li&gt;&#xA;&lt;li&gt;Save the new query rule&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h1 id=&#34;source&#34;&gt;Source&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://technet.microsoft.com/en-us/library/dn197173.aspx&#34;&gt;Display hybrid search results in SharePoint Server 2013&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&#34;http://blogs.msdn.com/b/spses/archive/2013/10/22/office-365-configure-hybrid-search-with-directory-synchronization.aspx&#34;&gt;Office 365-Configure Hybrid Search with Directory Synchronization –Password Sync&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&#34;http://blogs.msdn.com/b/spses/archive/2014/01/05/office-365-configure-hybrid-search-with-directory-synchronization-password-sync-part2.aspx&#34;&gt;Office 365-Configure Hybrid Search with Directory Synchronization –Password Sync –Part2&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Office 365 DirSync do not import disabled users</title>
      <link>https://janikvonrotz.ch/2014/05/06/office-365-dirsync-do-not-import-disabled-users/</link>
      <pubDate>Tue, 06 May 2014 09:13:03 +0000</pubDate>
      <guid>https://janikvonrotz.ch/2014/05/06/office-365-dirsync-do-not-import-disabled-users/</guid>
      <description>&lt;p&gt;One of my clients mentioned that he follows people in the newsfeed who weren&amp;rsquo;t employed any more.&lt;/p&gt;&#xA;&lt;p&gt;Occasionally we disable the this kind of users in the Active Directory but don&amp;rsquo;t delete them.&lt;/p&gt;&#xA;&lt;p&gt;It seems that DirSync doesn&amp;rsquo;t filter disabled accounts.&lt;/p&gt;&#xA;&lt;p&gt;To change that open the Synchronization Service Manager and navigate to &amp;gt; Management Agents &amp;gt; [your connector] &amp;gt; Configure Connect Filter.&lt;/p&gt;&#xA;&lt;p&gt;Now we are going to add a new attribute filter for the account control attribute.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Select &lt;strong&gt;user&lt;/strong&gt; as Data Source Object Type.&lt;/li&gt;&#xA;&lt;li&gt;Click on &lt;strong&gt;New&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Select &lt;strong&gt;userAccountControl&lt;/strong&gt; for Data source attribute&lt;/li&gt;&#xA;&lt;li&gt;Operator is &lt;strong&gt;Equal&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Set value &lt;strong&gt;0x202&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Add the new condition and finish with OK.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://janikvonrotz.ch/wp-content/uploads/2014/05/Configure-Connector-Filter-Account-Disabled.png&#34;&gt;&lt;img src=&#34;https://janikvonrotz.ch/wp-content/uploads/2014/05/Configure-Connector-Filter-Account-Disabled-1024x534.png&#34; alt=&#34;Configure Connector Filter - Account Disabled&#34;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Finally run a full sync with PowerShell.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Add-PSSnapin Coexistence-Configuration&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Start-OnlineCoexistenceSync -FullSync&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There shouldn&amp;rsquo;t be any disabled users in your azure directory any more.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
