DEV Community

Cover image for How do you configure user accounts and permissions in Azure Active Directory?๐Ÿ”
Aravind Manikandan
Aravind Manikandan

Posted on

How do you configure user accounts and permissions in Azure Active Directory?๐Ÿ”

To set up user accounts and manage permissions, in Azure Active Directory (Azure AD) there are methods including the ๐Ÿ”ต #Azureportal, โš™๏ธ #PowerShell or the ๐Ÿ“Š#MicrosoftGraphAPI.

Using the Azure portal:

  1. Navigate to the Azure portal. Log in with your AD administrator account.
  2. Locate the search bar and type โ€œAzure Active Directory โ€œ then select the service.
  3. In the navigation pane choose โ€œUsers.โ€
  4. Click on the โ€œAdd userโ€ button.
  5. Enter all information for the user, including their email address.
  6. Select โ€œCreateโ€ to finalize the user account creation.

Once you have created a user account you can assign permissions to that user by following these steps:

  1. Click on the name of the user, from your list of users.
  2. In the navigation pane choose โ€œPermissions.โ€
  3. Click on โ€œAssign permissions.โ€
  4. Select which permissions you want to assign to this user.
  5. Click on โ€œAssignโ€ to apply these permissions.

Using PowerShell:

To configure both user accounts and permissions using PowerShell you can utilize a set of commands specifically designed for this purpose.

# Create a new user account
New-AzureADUser -DisplayName "Alice" -UserPrincipalName alice@contoso.com

# Assign a role to a user account
Add-AzureADRoleAssignment -ObjectId "alice@contoso.com" -RoleDefinitionName "User Administrator"

To grant access rights to a user account you can utilize the command provided below:

# Assign custom permissions to a user account
New-AzureADPermissionGrant -ObjectId "alice@contoso.com" -ResourceUri "https://myapp.azure.com/api/v1/users" -PermissionScope "Read"

Using the Microsoft Graph API

To configure user accounts and permissions using the Microsoft Graph API, you can use the following requests:

# Create a new user account
POST https://graph.microsoft.com/v1.0/users
Content-Type: application/json

{
"displayName": "Alice",
"userPrincipalName": "alice@contoso.com"
}

# Assign a role to a user account
POST https://graph.microsoft.com/v1.0/users/alice@contoso.com/roleAssignments
Content-Type: application/json

{
"roleDefinitionId": "00000000-0000-0000-0000-000000000000",
"principalId": "alice@contoso.com"
}

# Assign custom permissions to a user account
POST https://graph.microsoft.com/v1.0/users/alice@contoso.com/permissions
Content-Type: application/json

{
"resourceUri": "https://myapp.azure.com/api/v1/users",
"permissionScopes": ["Read"]

๐Ÿ“š Elevate Your Microsoft 365 Mastery: Take on the Whizlabs Microsoft 365 Administrator Proficiency Exam (MS-102) ๐ŸŽ“

Here are some recommendations, for setting up user accounts and permissions in Azure AD:

  1. ๐Ÿ”’ Utilize Azure AD groups to efficiently manage user permissions. This simplifies the process of assigning or revoking permissions for groups of users.

  2. ๐Ÿ›ก๏ธ Make use of AD roles to grant users access to resources and privileges they require. This ensures you have control over access to your AD resources.

  3. ๐Ÿš€ Leverage Azure AD permissions to provide users with access to actions on resources. This offers you the control over user access.

  4. ๐ŸŒ Implement Azure AD conditional access policies that limit user access based on factors like device compliance, location and time of day. This adds a layer of security to safeguard your AD resources from unauthorized entry.

In conclusion ๐Ÿ’ผ by following these guidelines you can effectively configure user accounts and permissions, in Azure AD according to the requirements of your organization.๐Ÿ“‹

Top comments (0)