Muokkaa

Jaa


New-AzureADMSRoleDefinition

Creates an Azure AD role definition.

Syntax

New-AzureADMSRoleDefinition
   [-Description <String>]
   -DisplayName <String>
   [-ResourceScopes <System.Collections.Generic.List`1[System.String]>]
   -IsEnabled <Boolean>
   -RolePermissions <System.Collections.Generic.List`1[Microsoft.Open.MSGraph.Model.RolePermission]>
   [-TemplateId <String>]
   [-Version <String>]
   [<CommonParameters>]

Description

The New-AzureADMSRoleDefinition cmdlet creates an Azure Active Directory (Azure AD) role definition.

Examples

Example 1

PS C:\>
$allowedResourceAction = @()
$allowedResourceAction += @("microsoft.directory/applications/create")
$rolePermission = @{'allowedResourceActions' = $allowedResourceAction}
$rolePermissions = @()
$rolePermissions += $rolePermission

$resourceScopes = @()
$resourceScopes += '/'

New-AzureADMSRoleDefinition -RolePermissions $rolePermissions -IsEnabled $true -DisplayName 'MyRoleDefinition' -ResourceScopes $resourceScopes

Id              : c466024e-f757-4409-a897-d780916814b1
OdataType       :
Description     :
DisplayName     : fgdf
IsBuiltIn       : False
ResourceScopes  : {/}
IsEnabled       : True
RolePermissions : {class RolePermission {
                  AllowedResourceActions:
                  microsoft.directory/applications/create
                    Condition:
                  }
                  }
TemplateId      : f2ef992c-3afb-46b9-b7cf-a126ee74c451
Version         :

This command creates a new role definition in Azure AD.

Parameters

-Description

Specifies a description for the role definition.

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

-DisplayName

Specifies a display name for the role definition.

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

-IsEnabled

Specifies whether the role definition is enabled.

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

-ResourceScopes

Specifies the resource scopes for the role definition.

Type:List<T>[String]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RolePermissions

Specifies permissions for the role definition.

Type:List<T>[Microsoft.Open.MSGraph.Model.RolePermission]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-TemplateId

Specifies the template ID for the role definition.

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

-Version

Specifies version for the role definition.

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

Outputs

Microsoft.Open.MSGraph.Model.DirectoryRoleDefinition

Notes

See the migration guide for New-AzureADMSRoleDefinition to the Microsoft Graph PowerShell.