[コンテンツの検索] の検索対象を全ユーザーではなく、特定のユーザー制限する場合、アクセス許可フィルターの機能を利用することで可能です。
なお、ドメイン単位で制御する場合、EmailAddresses を対象に "*ドメイン" と後方一致で指定することで可能ですが、想定していないユーザーが検索対象となることがあり、確実ではないようです。
一つの方法として、カスタム属性 (CustomAttribute) をドメインごとに固有の値を登録し、アクセス許可フィルターの条件として CustomAttribute を指定することで確実にドメイン単位での制御が可能です。
以下に手順をご紹介したいと思います。
1. ドメインごとに CustomAttribute の値を登録
1. 対象のメールアドレスを [Identity] 列、カスタム属性を [CustomAttribute1] 列として CSV ファイルを作成します。
例:
Identity,CustomAttribute1
user04@contoso.onmicrosoft.com,ドメイン2
user05@contoso.onmicrosoft.com,ドメイン2
上記の例では、contoso.com のドメインであるユーザーに対して CustomAttribute1 に "ドメイン1" と登録し、contoso.onmicrosoft.com のドメインであるユーザーに対して CustomAttribute1 に "ドメイン2" と登録してます。
<UTF-8 での保存の手順>
1-1. メモ帳を起動し、上記の形式で登録する内容を記載します。
1-2. ファイル] - [名前を付けて保存] の順にクリックします。
1-3. ファイルの種類で「すべてのファイル」を選択します。
1-5. [保存] をクリックします。
2. 以下の Windows PowerShell コマンドレットを実行ます。
以下のサイトの手順にて、Exchange Online に接続してから実行してください。
[基本構文]
Import-CSV "<CSV ファイルのパス>\<ファイル名>.csv" | foreach {Set-Mailbox -Identity $_.Identity -CustomAttribute1 $_.CustomAttribute1 }
[実行例]
Import-CSV "C:\Temp\Attribute.csv" | foreach {Set-Mailbox -Identity $_.Identity -CustomAttribute1 $_.CustomAttribute1 }
3. 以下の Windows PowerShell コマンドレットを実行し、テナント内のユーザーメールボックスを対象として、設定が反映されたことを確認します。
[構文]
Get-Mailbox -ResultSize unlimited -RecipientTypeDetails UserMailbox | Select DisplayName,PrimarySmtpAddress,CustomAttribute1 | Export-CSV -Encoding UTF8 -Path <ファイルパス\ファイル名>.csv -NoTypeInformation
[実行例]
Get-Mailbox -ResultSize unlimited -RecipientTypeDetails UserMailbox | Select DisplayName,PrimarySmtpAddress,CustomAttribute1 | Export-CSV -Encoding UTF8 -Path C:\temp\UserMailbox.csv -NoTypeInformation
<出力結果>
DisplayName : 表示名
PrimarySmtpAddress : プライマリアドレス
CustomAttribute1 : カスタム属性
2. アクセス許可フィルターを設定します。
以下の公開情報をもとにセキュリティコンプライアンスセンターに接続してから実行してください。
[構文]
New-ComplianceSecurityFilter -FilterName "フィルター名" -Action All -Users "検索実行者のメールアドレス" -Filters "Mailbox_EmailAddresses -eq '検索対象とするドメインのカスタム属性'"
[実行例]
New-ComplianceSecurityFilter -FilterName "contoso" -Action All -Users "Admin@contoso.com" -Filters "Mailbox_CustomAttribute1 -eq 'ドメイン1'"
上記の例では、Admin@contoso.com が [コンテンツの検索] で検索を実行した場合、CustomAttribute1 が "ドメイン1" (例では、contoso.com のドメイン) のユーザーのみ検索することができます。
コンテンツの検索については、以下の記事でご紹介しておりますので参考としてくださいね。