次の方法で共有


Microsoft 365 に接続されているネットワーク内のユーザー Viva Engage監査

会社のViva Engage ネットワークには、会社で働かなくなったユーザーが存在する可能性があります。 または、一部のViva Engageユーザーは、対応する Microsoft 365 アカウントを持っていないため、メールとパスワードでサインインしている可能性があります。 このような状況を分析し、アクションを実行するには、Viva Engageユーザーを監査できます。 これには、Viva Engage ユーザーの一覧をエクスポートし、Windows PowerShellに Azure Active Directory モジュールを使用して Microsoft 365 でこれらのViva Engage ユーザーの状態を見つけ、結果を分析してアクションを実行する必要があります。

ユーザー Viva Engage監査に加えて、Viva Engage サービスを Microsoft 365 からシームレスに管理する方法の詳細を理解したい場合があります。 詳細については、「Viva Engage ユーザーに Microsoft 365 ID を適用する」を参照してください。

Viva Engage ユーザーの一覧をエクスポートする

監査スクリプトを実行するには、その前に、スクリプトが使用するユーザーのリストを含む入力ファイルを作成する必要があります。 入力ファイルは、Viva Engageの [ユーザーのエクスポート] 関数を使用して作成します。

  1. Viva Engageで、[Viva Engage設定] アイコン を選択し、[ネットワーク 管理] を選択します。

  2. [ ユーザーのエクスポート] を選択します

  3. [ユーザーのエクスポート] ページで、[ すべてのユーザーのエクスポート] を選択し、[エクスポート] を選択 します

  4. エクスポートしたファイルを保存します。 ファイルは、ファイル名の拡張子が .zip の圧縮ファイルとして保存されます。

  5. 圧縮ファイルを保存した場所に移動して、それを展開します。

注:

圧縮ファイルには、いくつかのファイルが含まれています。 必要なのは users.csv という名前の最初のファイルだけです。

Microsoft 365 でViva Engageユーザーの状態を検索する

  1. Windows PowerShell用の Azure Active Directory モジュールをインストールして構成します。 この手順については、次のドキュメント「Microsoft Entra ID ヘルプ」を参照してください。

  2. 次のサンプル コードをコピーし、メモ帳などのテキスト エディターに貼り付け、ファイルを UserMatchToAzureAD.ps1として保存します。

    organizationのニーズに合わせて自由に変更してください。

     <#Copyright 2016  Microsoft Licensed under the Apache License, Version 2.0 (the "License");  you may not use this file except in compliance with the License.  You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software  distributed under the License is distributed on an "AS IS" BASIS,  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions  and limitations under the License.  Viva Engage auditing tool for Office 365 looks for active Viva Engage accounts  that  are missing from Office 365 / Azure AD.  Takes User.csv file from Viva Engage Data Export as the input file.   Compares all Active Viva Engage accounts in the input file to user   lookup in Azure AD. User is searched by both email and proxyAddresses.   The output csv file is exactly matching the source file, but it includes  three new columns: exists_in_azure_ad, object_id and azure_licenses:  exists_in_azure_ad: Will be TRUE or FALSE, and signals that the user can be, or cannot be found in Office 365 / Azure AD  object_id: For users that can be found, lists the ObjectId in Azure AD  azure_licenses: For users that can be found, lists the plans assigned to the user in Azure AD. 
    
     azurepowershell
    
     This information can be used to double check licenses are assigned correctly for each user.  
    
     azurepowershell
    
     Params -  UseExistingConnection: Defines if the script should try to use an existing Azure AD connection. Will prompt for credentials and will start a new connection if $FALSE. Default is $FALSE  InputFile: Source CSV file of users, coming from the Viva Engage User Export tool  OutputFile: Output location to save the final CSV to  Example -  UserMatchToAzureAD.ps1 -InputFile .\Users.csv -OutputFile .\Results.csv  #> 
    
     azurepowershell
    
     Param(
     	 [bool]$UseExistingConnection = $FALSE,
     	 [string]$InputFile = ".\Users.csv",
     	 [string]$Outputfile = ".\Results.csv"
     	) 
       if(!$UseExistingConnection){
     	   Write-Host "Creating a new connection. Login with your Office 365 Global Admin Credentials..."
     	   $msolcred = get-credential
     	   connect-msolservice -credential $msolcred
        }
        Write-Host "Loading all Office 365 users from Azure AD. This can take a while depending on the number of users..."
        $o365usershash = @{}
        get-msoluser -All | Select userprincipalname,proxyaddresses,objectid,@{Name="licenses";Expression={$_.Licenses.AccountplanId}} | ForEach-Object {
     	   $o365usershash.Add($_.userprincipalname.ToUpperInvariant(), $_)
     	   $_.proxyaddresses | ForEach-Object {
     		   $email = ($_.ToUpperInvariant() -Replace "SMTP:(\\*)*", "").Trim()
     		   if(!$o365usershash.Contains($email))
     		   {
     			   $o365usershash.Add($email, $_)
     		   }
     	   }
        }
        Write-Host "Matching Viva Engage users to Office 365 users"
        $yammerusers = Import-Csv -Path $InputFile | Where-Object {$_.state -eq "active"}
        $yammerusers | ForEach-Object {
     	   $o365user = $o365usershash[$_.email.ToUpperInvariant()]
     	   $exists_in_azure_ad = ($o365user -ne $Null)
     	   $objectid = if($exists_in_azure_ad) { $o365user.objectid } else { "" }
     	   $licenses = if($exists_in_azure_ad) { $o365user.licenses } else { "" }
     	   $_ | Add-Member -MemberType NoteProperty -Name "exists_in_azure_ad" -Value $exists_in_azure_ad
     	   $_ | Add-Member -MemberType NoteProperty -Name "azure_object_id" -Value $objectid
     	   $_ | Add-Member -MemberType NoteProperty -Name "azure_licenses" -Value $licenses
        } 
       Write-Host "Writing the output csv file..."
       $yammerusers | Export-Csv $Outputfile -NoTypeInformation 
       Write-Host "Done." 
    
  3. Windows PowerShell コマンド ウィンドウ用の Azure Active Directory モジュールから、次の例のようにコマンドを実行し、Viva Engageからエクスポートされた入力ファイルと出力ファイルの場所を渡します。

    使用例:

     UserMatchToAzureAD.ps1 -InputFile .\Users.csv -OutputFile .\Results.csv
    

    スクリプトの実行方法の詳細については、上記の PS1 ファイルを参照してください。

結果を分析し、アクションを実行する

  1. 結果の CSV ファイルを開き、exists_in_azure_ad列を FALSE として表示するすべての行を除外します。

    それぞれのアカウントはViva Engageに存在しますが、Microsoft 365/Microsoft Entra IDには存在しません。 それぞれのユーザーについて、次の操作を行う必要があるかどうかを判断します。

    • ユーザーがアクセスできない場合は、Viva Engageでユーザー アカウントを一時停止します。

    • Microsoft 365/Microsoft Entra ID でユーザーを作成します。

  2. これらの操作を完了したら、最初からこれらの手順をもう一度実行して、すべてのユーザーがMicrosoft Entra IDで見つかったことを確認することをお勧めします。

完全な監査の後、Microsoft 365 ID を適用する場合は、現在のすべてのユーザーをサインオフして、すべてのユーザーが Microsoft 365 資格情報でサインインし、キャッシュされた資格情報を使用しないようにすることを検討してください。 これを行う場合は、まずユーザーと通信してください。 詳細については、「Viva Engage ユーザーに Microsoft 365 ID を適用する」を参照してください