Get-AzRoleAssignmentScheduleInstance

取得指定的角色指派排程實例。

Syntax

Get-AzRoleAssignmentScheduleInstance
   -Scope <String>
   [-Filter <String>]
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzRoleAssignmentScheduleInstance
   -Name <String>
   -Scope <String>
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]
Get-AzRoleAssignmentScheduleInstance
   -InputObject <IAuthorizationIdentity>
   [-DefaultProfile <PSObject>]
   [<CommonParameters>]

Description

取得指定的角色指派排程實例。

範例

範例 1:列出資源的所有角色指派排程實例

$scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d"
Get-AzRoleAssignmentScheduleInstance -Scope $scope

Name                                 Type                                            Scope
----                                 ----                                            -----
986d4ad8-f513-4a21-92e5-7163486e9e7c Microsoft.Authorization/roleAssignmentScheduleInstances /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d
2066f412-e9bf-406a-962c-df8c16c9f9a0 Microsoft.Authorization/roleAssignmentScheduleInstances /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/resourceGroups/UTSept3/providers/Microsoft.Compute/virtualMachines/vmtest123
f402cab4-83ab-4361-8725-2190bbe1ea6b Microsoft.Authorization/roleAssignmentScheduleInstances /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/resourceGroups/sbo-test/providers/Microsoft.Web/connections/office365-1
5a12ea85-419e-426b-81f8-20e53808a14c Microsoft.Authorization/roleAssignmentScheduleInstances /providers/Microsoft.Management/managementGroups/PrimaryMG1

傳回 的所有 roleAssignmentScheduleInstancesscope。 若要呼叫 API,您必須具有指定範圍之作業的存取 Microsoft.Authorization/roleAssignments/read 權。

範例 2:列出資源的所有 「我」角色指派排程實例

$scope = "/" # "/" stands for tenant level resource
Get-AzRoleAssignmentScheduleInstance -Scope $scope -Filter "asTarget()"

Name                                 Type                                            Scope                                                 RoleDefinitionId
----                                 ----                                            -----                                                 ----------------                                                                      
4cd7e26b-8eca-425c-969d-ec708c88bf18 Microsoft.Authorization/roleAssignmentScheduleInstances /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d   /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/providers/Microsoft.Authorizatio… 
a1f32976-b8f4-4606-a91d-af097a2473a2 Microsoft.Authorization/roleAssignmentScheduleInstances /providers/Microsoft.Management/managementGroups/MG-3 /providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb… 
4f9bdc29-3bb9-4ad7-9c1d-3f3f5ba3e1d9 Microsoft.Authorization/roleAssignmentScheduleInstances /providers/Microsoft.Management/managementGroups/MG-2 /providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb… 
529e4bba-621c-4309-a4b2-73e3364d4dd3 Microsoft.Authorization/roleAssignmentScheduleInstances /providers/Microsoft.Management/managementGroups/MG-1 /providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb…

roleAssignmentScheduleInstancesscope回所有指派給呼叫使用者的 。

範例 3:列出具有篩選之資源的所有角色指派排程實例

$scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d"
$filter = "roleDefinitionId eq '/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635'"
Get-AzRoleAssignmentScheduleInstance -Scope $scope -Filter $filter

Name                                 Type                                            Scope                                                                                 RoleDefinitionId
----                                 ----                                            -----                                                                                 ----------------                                      
314aa57e-064d-46c3-964e-a0d20989c1a2 Microsoft.Authorization/roleAssignmentScheduleInstances /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d                                   /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/… 
496794ce-4465-4621-83aa-0b73b3c6fe17 Microsoft.Authorization/roleAssignmentScheduleInstances /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d                                   /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/… 
6461530a-4d10-400e-9eb0-ff7cb73c4ffd Microsoft.Authorization/roleAssignmentScheduleInstances /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d                                   /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/… 
d8daef6c-75da-42eb-9291-7cbc466d5b4b Microsoft.Authorization/roleAssignmentScheduleInstances /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d                                   /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/…

支持的篩選: |篩選 |描述 | |--- |--- | | atScope() |僅列出指定範圍的角色指派,不包括子範圍的角色指派。 | | principalId eq '{objectId}' |列出指定使用者、群組或服務主體的角色指派。 | | roleDefinitionId eq '{roleDefinitionId}' |列出指定角色定義的角色指派。 | | status eq '{status}' |列出指定狀態的角色指派。 | | assignedTo('{objectId}') |列出指定使用者的角色指派,包括繼承自群組的角色指派。 | | asTarget() |列出目前用戶或服務主體的角色指派,包括繼承自群組的角色指派。 | | assignedTo('{objectId}')+and+atScope() |列出指定使用者的角色指派,包括只從指定範圍繼承自群組的角色指派,不包括子範圍的角色指派。|

範例 4:依範圍和名稱取得角色指派排程實例

$scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d"
Get-AzRoleAssignmentScheduleInstance -Scope $scope -Name "4cd7e26b-8eca-425c-969d-ec708c88bf18"

Name                                 Type                                            Scope                                               RoleDefinitionId
----                                 ----                                            -----                                               ----------------                                                                        
4cd7e26b-8eca-425c-969d-ec708c88bf18 Microsoft.Authorization/roleAssignmentScheduleInstances /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d /subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/providers/Microsoft.Authorization/…

Id使用屬性來取得 scopename

參數

-DefaultProfile

DefaultProfile 參數無法運作。 如果針對不同的訂用帳戶執行 Cmdlet,請使用 SubscriptionId 參數。

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Filter

要套用至作業的篩選條件。 使用 $filter=atScope() 傳回範圍或上方的所有角色指派排程。 使用 $filter=principalId eq {id} 傳回指定主體範圍以上或以下的所有角色指派排程。 使用 $filter=assignedTo('{userId}') 傳回使用者的所有角色指派排程實例。 使用 $filter=asTarget() 傳回為目前使用者建立的所有角色指派排程實例。

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Type:IAuthorizationIdentity
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

要取得之角色指派排程的名稱(排程名稱 + 時間的哈希)。

Type:String
Aliases:RoleAssignmentScheduleInstanceName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Scope

角色指派排程的範圍。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

輸入

IAuthorizationIdentity

輸出

IRoleAssignmentScheduleInstance