New-AzureADMSRoleDefinition
Creates an Azure AD role definition.
Syntax
Default (Default)
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.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DisplayName
Specifies a display name for the role definition.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IsEnabled
Specifies whether the role definition is enabled.
Parameter properties
Type: Boolean
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceScopes
Specifies the resource scopes for the role definition.
Parameter properties
Type: List<T> [ String ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-RolePermissions
Specifies permissions for the role definition.
Parameter properties
Type: List<T> [ Microsoft.Open.MSGraph.Model.RolePermission ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TemplateId
Specifies the template ID for the role definition.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Version
Specifies version for the role definition.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs
Microsoft.Open.MSGraph.Model.DirectoryRoleDefinition
Notes