SharePoint Server において個人用サイトのホスト URL で Exchange 自動検出を構成する

適用対象:yes-img-13 2013yes-img-162016 yes-img-192019 yes-img-seSubscription Edition no-img-sopSharePoint in Microsoft 365

SharePoint Server では、個人用サイト は、コンテンツの共有、ディスカッション、およびユーザーがジョブを行うためのその他の機能を有効にする豊富なソーシャル ネットワーキング機能とコラボレーション機能をユーザーに提供しています。 Exchange Server 2013 自動検出サービスでは、指定されたユーザー名とパスワードに基づいて、メール クライアントとモバイル デバイスにプロファイル設定を構成します。 自動検出サービスは、個人用サイトで Office 2016 クライアント統合のための構成をより簡単かつシームレスに行えるように構成することもできます。 たとえば、Office 2016 クライアントと携帯電話のアプリは、Exchange 自動検出を使用して、Active Directory ドメイン サービス (AD DS) に格納されている個人用サイトのホスト URL に基づいて、ユーザーの 個人用サイト を検出できます。 以下の操作を行うためのクライアント機能の構成とプロビジョニングについては、個人用サイトのホスト URL を識別して入力しなくても、ユーザーの電子メール アドレスとパスワードさえあれば行うことができます。

  • Microsoft OneDrive - OneDrive の場所にドキュメントを開いて保存します。

  • デバイスでニュースフィードにアクセスする。

  • Office ハブ — Windows Phone でアプリケーションをセット アップする。

この記事では、SharePoint Server の個人用サイトのホスト URL で AD DS を更新するために必要な手順を記載しています。 また、現在の現在の個人用サイトのホスト URL の値を確認したり置き換えたりする必要がある場合に、現在の個人用サイトのホスト URL を取得または削除するために必要な手順についても詳しく記載しています。

重要

次のセクションに進む前に、SharePoint Server 環境と Exchange Server 2013 環境を既にインストールし、構成している必要があります。 さらに、SharePoint Server で 個人用サイト をセットアップして構成する必要もあります。 個人用サイト の実装方法と、個人用サイトのホスト URL の取得方法の詳細については、「SharePoint Server で個人用サイトを構成する」を参照してください。

個人用サイトのホスト URL で Exchange 自動検出を構成する

個人用サイトのホスト URL で AD DS を更新するには、Exchange 管理シェルを使用して Exchange Server コンピューターでスクリプトを実行する必要があります。 この手順では、PowerShell スクリプトを作成してから、指定された URL 値で AD DS を更新するスクリプトを実行します。 この手順では、必要に応じて個人用サイトのホスト URL エントリを確認および削除するオプションの手順についても記載します。 スクリプトの実行方法の詳細については、Exchange Server 2013 テクニカル ライブラリにある「Exchange 管理シェルを使用したスクリプトの作成」を参照してください。

個人用サイトのホスト URL で Exchange 自動検出を構成するには

  1. Exchange Server 2013 コンピューターで、次のスクリプトの内容をメモ帳にコピーします。 このファイルを任意の場所に保存し、その際、このファイルが PowerShell スクリプトであることを示す .ps1 拡張子を使用します。 最後に、ファイルの名前を SetMySiteHostURLInAD.ps1 に変更します。
function PrintUsage
{
@"
NAME:
SetMySiteHostURLInAD.ps1
SYNOPSIS:
The purpose of this script is to set My Site Host URL in Active Directory.
This URL will be returned through Exchange Autodiscover.
MySiteHostURL - URL of My Site Host to set in Active Directory.
Or use -get to get My Site Host URL from Active Directory.
Or use -remove to remove My Site Host URL from Active Directory.
SYNTAX:
SetMySiteHostURLInAD.ps1 "MySiteHostURL" | -get | -remove
EXAMPLES:
SetMySiteHostURLInAD.ps1 "http://my"
SetMySiteHostURLInAD.ps1 -get
SetMySiteHostURLInAD.ps1 -remove
"@
}
function GetConfigurationNamingContextPath
{
    return GetEntryProperty "LDAP://RootDSE" "configurationNamingContext"
}
function GetExchangePath
{
    param([string]$configurationNamingContextPath)
    return "LDAP://CN=Microsoft Exchange,CN=Services," + $configurationNamingContextPath
}
function GetOrganizationContainerPath
{
    param([string]$exchangePath)
    [string]$organizationContainerPath = ""
    ([ADSI] $exchangePath).Children | foreach {
      if (!$organizationContainerPath -and $_.SchemaClassName -eq "msExchOrganizationContainer") {
         $organizationContainerPath = $_.Path
            }
    }
    return $organizationContainerPath
}
function GetEntryProperty
{
    param([string]$entryPath, [string]$propertyName)
    $entry = [ADSI] $entryPath
    [string]$value = ""
    trap {
         continue
    }
    $value = $entry.Get($propertyName)
    return $value
}
function SetEntryProperty
{
    param([string]$entryPath, [string]$propertyName, [string]$propertyValue)
    $entry = [ADSI] $entryPath
    if (!$propertyValue)
    {
        $entry.PutEx(1, $propertyName, $null)
    }
    else
    {
        $entry.Put($propertyName, $propertyValue)
    }
    trap {
        Write-Host "`nError setting property" -ForegroundColor Red
        continue
    }
    $entry.SetInfo()
}
function AddOrReplaceOrRemoveMySiteHostURL
{
    param([string]$old, [string]$url)
    [string]$separator = ";"
    [string]$label = "SPMySiteHostURL" + $separator
    if (!$old)
      {
         if (!$url)
            {
              return ""
            }
         else
            {
              return $label + $url
            }
      }
    [int]$labelPosition = $old.IndexOf($label)
    if ($labelPosition -eq -1)
      {
         if (!$url)
            {
              return $old
            }
         else
            {
              if ($old[$old.Length - 1] -eq $separator)
              {
              return $old + $label + $url
              }
              else
              {
        return $old + $separator + $label + $url
              }
            }
        }
    [int]$valuePosition = $labelPosition + $label.Length
    [int]$nextLabelPosition = $old.IndexOf($separator, $valuePosition)
     if ($nextLabelPosition -eq -1)
       {
         if (!$url)
         {
              if ($labelPosition -eq 0)
              {
                 return ""
              }
              else
              {
                 return $old.Substring(0, $labelPosition - 1)
              }
          }
         else
         {
              return $old.Substring(0, $valuePosition) + $url
         }
      }
     if (!$url)
       {
          return $old.Substring(0, $labelPosition) + $old.Substring($nextLabelPosition + 1)
       }
      else
       {
          return $old.Substring(0, $valuePosition) + $url + $old.Substring($nextLabelPosition)
       }
}
if ($args.Count -ne 1)
{
    Write-Host "`nError: Required argument missing or too many arguments" -ForegroundColor Red
    PrintUsage
    exit
}
if ($args[0] -eq "-?" -or $args[0] -eq "-h" -or $args[0] -eq "-help")
{
    PrintUsage
    exit
}
[string]$url = ""
if ($args[0] -ne "-r" -and $args[0] -ne "-remove")
{
    $url = $args[0]
}
Write-Host "`nSetting My Site Host URL in Active Directory..."
[string]$configurationNamingContextPath = GetConfigurationNamingContextPath
Write-Host "`nConfiguration Naming Context path: $configurationNamingContextPath"
[string]$exchangePath = GetExchangePath $configurationNamingContextPath
Write-Host "`nExchange path: $exchangePath"
[string]$organizationContainerPath = GetOrganizationContainerPath $exchangePath
Write-Host "`nOrganization Container path: $organizationContainerPath"
[string]$propertyName = "msExchServiceEndPointURL"
Write-Host "`nProperty name: $propertyName"
[string]$old = GetEntryProperty $organizationContainerPath $propertyName
Write-Host "`nOld value: $old"
if (!$url)
{
    Write-Host "`nRemoving value"
}
elseif ($url -eq "-g" -or $url -eq "-get")
{
    Write-Host ""
    exit
}
else
{
    Write-Host "`nAdding or replacing value: $url"
}
[string]$new = AddOrReplaceOrRemoveMySiteHostURL $old $url
Write-Host "`nNew value: $new"
SetEntryProperty $organizationContainerPath $propertyName $new
Write-Host ""
  1. Exchange 管理シェルを開きます。

  2. Exchange 管理シェルで、スクリプトを保存したディレクトリに移動してから、指定した個人用サイトのホスト URL でスクリプトを実行します。 たとえば、ホスト URL が http://server/sites/contoso の場合、Exchange 管理シェルの構文は次のようになります。

[PS] C:\>  c:\SetMySiteHostURLInAD.ps1      http://server/sites/contoso
  1. ENTER キーを押してこのスクリプトを実行し、個人用サイトのホスト URL で AD DS を更新します。

  2. URL が正しく更新されたことを確認するには、次のコマンドを実行します。

[PS] C:\>  c:\SetMySiteHostURLInAD.ps1      -get

オプションで、次のコマンドを入力すると、個人用サイトのホスト URL を削除できます。

[PS] C:\>  c:\SetMySiteHostURLInAD.ps1  -remove

個人用サイトのホスト URL を構成した後は、SharePoint サーバーの全体管理 Web サイトでも値を確認することができます。 [アプリケーション管理] から、 [サービス アプリケーションの管理][ユーザー プロファイル サービス アプリケーション] (またはユーザー プロファイル サービス アプリケーションで選択した他の名前)、 [個人用サイトの設定][個人用サイトのセットアップ] の順に移動します。 [個人用サイトの設定] ページで、 [Active Directory の個人用サイトのホスト URL] フィールドが入力されていることがわかります。

Active Directory の [個人用サイトのホストの URL]

注:

[Active Directory の個人用サイトのホスト URL] フィールドは、サーバーの全体管理を介して入力することはできないため、個人用サイトのホスト URL の値は上記の詳細なプロセスによって指定する必要があります。

関連項目

概念

SharePoint Server で個人用サイトを構成する