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 62e90356-69f5-4237-9190-012177145e10 -PrincipalId 69584089-b4d1-4055-9c94-320412efd653 -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.