New-AzureADMSRoleAssignment

Creates an Azure AD role assignment.

Syntax

New-AzureADMSRoleAssignment
   -RoleDefinitionId <String>
   -PrincipalId <String>
   [-DirectoryScopeId <String>]
   [<CommonParameters>]

Description

The New-AzureADMSRoleAssignment cmdlet creates an Azure Active Directory (Azure AD) role assignment.

Examples

Example 1

PS C:\> New-AzureADMSRoleAssignment -RoleDefinitionId f2ef992c-3afb-46b9-b7cf-a126ee74c451 -PrincipalId aaaaaaaa-bbbb-cccc-1111-222222222222 -DirectoryScopeId '/'

This command creates a new role assignment.

Parameters

-DirectoryScopeId

Specifies the scope for the role assignment.

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

-PrincipalId

Specifies the principal for role assignment.

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

-RoleDefinitionId

Specifies the role definition for role assignment.

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

Outputs

Microsoft.Open.MSGraph.Model.DirectoryRoleAssignment

Notes

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