Get-EntraDirectoryRole

ディレクトリ ロールを取得します。

構文

GetQuery (既定)

Get-EntraDirectoryRole

    [-Filter <String>]
    [-Property <String[]>]
    [<CommonParameters>]

GetById

Get-EntraDirectoryRole

    -DirectoryRoleId <String>
    [-Property <String[]>]
    [<CommonParameters>]

説明

Get-EntraDirectoryRole コマンドレットは、Microsoft Entra IDからディレクトリ ロールを取得します。 ディレクトリ ロール ObjectId 取得するパラメーターを指定します。

職場または学校アカウントを使用する委任されたシナリオでは、サインインしているユーザーは、サポートされているMicrosoft Entraロールまたは必要なアクセス許可を持つカスタム ロールを持っている必要があります。 この操作では、次の最小特権ロールがサポートされています。

  • ユーザー管理者
  • ヘルプデスク管理者
  • サービス サポート管理者
  • 請求管理者
  • ディレクトリの読み手
  • ディレクトリ製作者
  • アプリケーション管理者
  • セキュリティリーダー
  • セキュリティ管理者
  • 特権ロール管理者
  • クラウド アプリケーション管理者

例 1: ID でディレクトリ ロールを取得する

Connect-Entra -Scopes 'RoleManagement.Read.Directory'
$directoryRole = Get-EntraDirectoryRole -Filter "displayName eq 'Helpdesk Administrator'"
Get-EntraDirectoryRole -DirectoryRoleId $directoryRole.Id
ObjectId                             DisplayName                        Description
--------                             -----------                        -----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Helpdesk Administrator              Company Administrator role has full access to perform any operation in the company scope.

このコマンドは、指定されたディレクトリ ロールを取得します。

  • -ObjectIdパラメーターは、Microsoft Entra IDのディレクトリ ロールの ID を指定します。

例 2: すべてのディレクトリ ロールを取得する

Connect-Entra -Scopes 'RoleManagement.Read.Directory'
Get-EntraDirectoryRole
DeletedDateTime Id                                   Description
--------------- --                                   -----------
                aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Perform all migration functionality to migrate content to Microsoft 365 usin...
                aaaaaaaa-6666-7777-8888-bbbbbbbbbbbb Can manage all aspects of users and groups, including resetting passwords fo...
                bbbbbbbb-7777-8888-9999-cccccccccccc Can read basic directory information. Commonly used to grant directory read ...
                cccccccc-8888-9999-0000-dddddddddddd Can read and write basic directory information. For granting access to appli...

このコマンドは、すべてのディレクトリ ロールを取得します。

例 3: ID でディレクトリ ロール フィルターを取得する

Connect-Entra -Scopes 'RoleManagement.Read.Directory'
Get-EntraDirectoryRole -Filter "Id eq 'c0e36062-8c80-4d72-9bc3-cbb4efe03c21'"
Id                             DisplayName                        Description
--------                             -----------                        -----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Helpdesk Administrator              Company Administrator role has full access to perform any operation in the company scope.

このコマンドは、ID によってディレクトリ ロールを取得します。

  • -Idパラメーターは、Microsoft Entra IDのディレクトリ ロールの ID を指定します。

例 4: displayName でディレクトリ ロール フィルターを取得する

Connect-Entra -Scopes 'RoleManagement.Read.Directory'
Get-EntraDirectoryRole -Filter "displayName eq 'Helpdesk Administrator'"
DeletedDateTime Id                                   Description
--------------- --                                   -----------
                aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Can reset passwords for non-administrators and Helpdesk Administrators....

このコマンドは、表示名でディレクトリ ロールを取得します。

パラメーター

-DirectoryRoleId

Microsoft Entra IDのディレクトリ ロールの ID を指定します。

パラメーターのプロパティ

型:System.String
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:オブジェクト識別子

パラメーター セット

GetById
配置:Named
必須:True
パイプラインからの値:True
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-Filter

OData v4.0 フィルター ステートメント。 返されるオブジェクトを制御します。

パラメーターのプロパティ

型:System.String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

GetQuery
配置:Named
必須:False
パイプラインからの値:True
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-Property

返されるプロパティを指定します。

パラメーターのプロパティ

型:

System.String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:Select

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

CommonParameters

このコマンドレットでは、一般的なパラメーター -Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction、-WarningVariable の各パラメーターがサポートされています。 詳細については、about_CommonParametersを参照してください。