尋找使用者的副檔名屬性Locate Extension Attributes for Users

SDS 可為使用者同步處理的選擇性屬性,會儲存在 Azure AD 中的每個個別使用者上做為副檔名屬性。The optional attributes that SDS can sync over for users are stored on each individual user in Azure AD as Extension Attributes. 使用者可以使用 PowerShell 或圖形來尋找使用者的副檔名屬性。群組和管理單位擴充屬性只能在圖形中或由呼叫 Graph API 的應用程式中查看。Extension Attributes for Users can be located utilizing PowerShell or Graph however Groups and Administrative Unit extension Attributes can only be viewed in Graph or by applications calling the Graph API.

在遵循下列步驟之前,請確認已安裝 AzureAD 的適當模組。Before following the steps below confirm the proper modules for AzureAD is installed. 您可以在以下位置找到指示: 針對 SDS PowerShellInstructions can be found here: PowerShell For SDS.

選取使用者Selecting a User

若要尋找單一使用者擴充屬性,必須先找出其物件/圖形識別碼。To locate a single users extension attribute, we must first locate their Object/Graph ID. 您可以使用下列其中一個命令,以一些不同的方式完成。This can be done a few different ways, we recommend using one of the below commands. 您可以在以下位置找到完整詳細資料: AzureADUserFull details can be found here: Get-AzureADUser.

範例1:取得租使用者上的所有使用者Example 1: Get all users on Tenant

Get-AzureADUser -All $true

範例2:依識別碼取得使用者Example 2: Get a User by ID

Get-AzureADUser -ObjectId "firstName.lastName@contoso.com"

範例3:依顯示名稱取得使用者Example 3: Get a User by Display Name

Get-AzureADUser -SearchString "firstName"

查看擴充屬性Viewing Extension Attributes

我們可以使用以上所列使用者的物件/圖形識別碼或命令組合,傳回已經同步處理的屬性清單。We can use the Object/Graph ID of the user we located above or a combination of commands, to return the list of attributes that have been synced. 您可以在以下位置找到其中一個可用命令的完整詳細資料: AzureADUserExtensionFull details of one of the commands used can be found here: Get-AzureADUserExtension

範例1:取得具有識別碼的單一使用者的擴充屬性Example 1: Get Extension Attributes of a Single User with ID

Get-AzureADUserExtension -ObjectId <String>

範例2:取得租使用者上所有使用者的副檔名屬性Example 2: Get Extension Attributes of all Users on Tenant

$UserId = (Get-AzureADUser -All $true).objectId
foreach ($Object in $UserId) {Get-AzureADUserExtension -ObjectId $Object}

範例3:使用 Get-AzureADUser 選項取得 Extension 屬性Example 3: Get Extension Attribute with Get-AzureADUser selection

Get-AzureADUser -SearchString "firstName" | select -ExpandProperty ExtensionProperty