Set-AzRoleAssignment
Mevcut Rol Ataması'nın güncelleştirilmiş hali.
Cmdlet, giriş parametrelerine göre Microsoft Graph API'sinin altında çağrı yapabilir:
- GET /users/{id}
- GET /servicePrincipals/{id}
- GET /groups/{id}
- GET /directoryObjects/{id}
- POST /directoryObjects/getByIds
Rol ataması nesnesi bulunamazsa veya geçerli hesabın nesne türünü almak için yeterli ayrıcalığı yoksa, bu cmdlet'in çıktıda olarak Unknown
işaretlendiğini ObjectType
lütfen unutmayın.
Syntax
Set-AzRoleAssignment
-InputObject <PSRoleAssignment>
[-SkipClientSideScopeValidation]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzRoleAssignment
-InputFile <String>
[-SkipClientSideScopeValidation]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Mevcut atamayı değiştirmek için Set-AzRoleAssignment komutunu kullanın.
Açıklamalar herhangi bir geçerli dize olabilir, bunu kullanarak birbirinden farklı olabilir.
Koşul ayarlandıysa Koşul Sürümü de ayarlanmalıdır ancak gerekli olmayan bir Koşulu güncelleştiriyorsanız.
Koşul Sürümü 1.0'dan 2.0'a yükseltilebilir ancak geri alınamaz. 2.0, 1.0 ile geriye dönük uyumlu olmadığından dikkatli olun.
Örnekler
Örnek 1
$ConditionVersion = "2.0"
$Description = "This is a new role assignment for John"
$Condition = "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers/blobs:Path] StringEqualsIgnoreCase 'foo_storage_container'"
$roleAssignment = Get-AzRoleAssignment -Scope "/subscriptions/4e5329a6-39ce-4e13-b12e-11b30f015986/resourceGroups/contoso_rg" -PrincipalId "0c0f6cdc-90dd-4664-83c0-a0d986c4c604"
$roleAssignment.Description = $Description
$roleAssignment.Condition = $Condition
$roleAssignment.ConditionVersion = $ConditionVersion
Set-AzRoleAssignment -InputObject $roleAssignment -PassThru
RoleAssignmentId : /providers/Microsoft.Management/managementGroups/1273adef-00a3
-4086-a51a-dbcce1857d36/providers/Microsoft.Authorization/role
Assignments/926c2a76-be19-4281-94de-38777629b9dc
Scope : /subscriptions/4e5329a6-39ce-4e13-b12e-11b30f015986/resourceGroups/contoso_rg
DisplayName : John Doe
SignInName : John.Doe@Contoso.com
RoleDefinitionName : Owner
RoleDefinitionId : 8e3af657-a8ff-443c-a75c-2fe8c4bcb635
ObjectId : 0c0f6cdc-90dd-4664-83c0-a0d986c4c604
ObjectType : User
CanDelegate : False
Description : This is a new role assignment for John
ConditionVersion : 2.0
Condition : @Resource[Microsoft.Storage/storageAccounts/blobServices/containers/blobs:Path] StringEqualsIgnoreCase 'foo_storage_container'
Nesneyi değiştirerek mevcut rol atamasını güncelleştirme
Örnek 2
Set-AzRoleAssignment -InputFile "C:\RoleAssignments\example.json" -PassThru
RoleAssignmentId : /providers/Microsoft.Management/managementGroups/1273adef-00a3
-4086-a51a-dbcce1857d36/providers/Microsoft.Authorization/role
Assignments/926c2a76-be19-4281-94de-38777629b9dc
Scope : /subscriptions/4e5329a6-39ce-4e13-b12e-11b30f015986/resourceGroups/contoso_rg
DisplayName : John Doe
SignInName : John.Doe@Contoso.com
RoleDefinitionName : Owner
RoleDefinitionId : 8e3af657-a8ff-443c-a75c-2fe8c4bcb635
ObjectId : 0c0f6cdc-90dd-4664-83c0-a0d986c4c604
ObjectType : User
CanDelegate : False
Description : This is a new role assignment for John
ConditionVersion : 2.0
Condition : @Resource[Microsoft.Storage/storageAccounts/blobServices/containers/blobs:Path] StringEqualsIgnoreCase 'foo_storage_container'
Dosya kullanarak mevcut rol atamalarını güncelleştirme
Parametreler
-Confirm
Cmdlet'i çalıştırmadan önce sizden onay ister.
Tür: | SwitchParameter |
Aliases: | cf |
Position: | Named |
varsayılan değer: | None |
Gerekli: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
Azure ile iletişim için kullanılan kimlik bilgileri, hesap, kiracı ve abonelik.
Tür: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
varsayılan değer: | None |
Gerekli: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputFile
Tek bir rol tanımı içeren dosya adı.
Tür: | String |
Position: | Named |
varsayılan değer: | None |
Gerekli: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Rol Ataması.
Tür: | PSRoleAssignment |
Position: | Named |
varsayılan değer: | None |
Gerekli: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PassThru
Belirtilirse, güncelleştirilmiş rol atamasını görüntüler
Tür: | SwitchParameter |
Position: | Named |
varsayılan değer: | None |
Gerekli: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SkipClientSideScopeValidation
Belirtilirse, istemci tarafı kapsam doğrulamayı atlayın.
Tür: | SwitchParameter |
Position: | Named |
varsayılan değer: | None |
Gerekli: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Cmdlet çalıştırılıyorsa ne olacağını gösterir. Cmdlet çalıştırılmaz.
Tür: | SwitchParameter |
Aliases: | wi |
Position: | Named |
varsayılan değer: | None |
Gerekli: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |