Skip to content

Commit 6871865

Browse files
Update Azure AD cmdlets.
1 parent 658b318 commit 6871865

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

articles/role-based-access-control/tutorial-role-assignments-user-powershell.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: rolyon
66
manager: amycolannino
77

88
ms.service: role-based-access-control
9-
ms.custom: devx-track-azurepowershell, has-azure-ad-ps-ref
9+
ms.custom: devx-track-azurepowershell, has-azure-ad-ps-ref, azure-ad-ref-level-one-done
1010
ms.topic: tutorial
1111
ms.workload: identity
1212
ms.date: 02/02/2019
@@ -54,21 +54,20 @@ To assign a role, you need a user, group, or service principal. If you don't alr
5454
1. In Azure Cloud Shell, create a password that complies with your password complexity requirements.
5555

5656
```azurepowershell
57-
$PasswordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
58-
$PasswordProfile.Password = "Password"
57+
$PasswordProfile = @{ Password = "<Password>" }
5958
```
6059
61-
1. Create a new user for your domain using the [New-AzureADUser](/powershell/module/azuread/new-azureaduser) command.
60+
1. Create a new user for your domain using the [New-MgUser](/powershell/module/microsoft.graph.users/new-mguser) command.
6261
6362
```azurepowershell
64-
New-AzureADUser -DisplayName "RBAC Tutorial User" -PasswordProfile $PasswordProfile `
65-
-UserPrincipalName "[email protected]" -AccountEnabled $true -MailNickName "rbacuser"
63+
New-MgUser -DisplayName "RBAC Tutorial User" -PasswordProfile $PasswordProfile `
64+
-UserPrincipalName "[email protected]" -AccountEnabled:$true -MailNickName "rbacuser"
6665
```
67-
68-
```Example
69-
ObjectId DisplayName UserPrincipalName UserType
70-
-------- ----------- ----------------- --------
71-
11111111-1111-1111-1111-111111111111 RBAC Tutorial User [email protected] Member
66+
67+
```output
68+
DisplayName Id Mail UserPrincipalName
69+
----------- -- ---- -----------------
70+
RBAC Tutorial User 11111111-1111-1111-1111-111111111111 [email protected]
7271
```
7372
7473
## Create a resource group
@@ -264,10 +263,11 @@ To clean up the resources created by this tutorial, delete the resource group an
264263
265264
1. When asked to confirm, type **Y**. It will take a few seconds to delete.
266265
267-
1. Delete the user using the [Remove-AzureADUser](/powershell/module/azuread/remove-azureaduser) command.
266+
1. Delete the user using the [Remove-MgUser](/powershell/module/microsoft.graph.users/remove-mguser) command.
268267
269268
```azurepowershell
270-
Remove-AzureADUser -ObjectId "[email protected]"
269+
$User = Get-MgUser -Filter "DisplayName eq 'RBAC Tutorial User'"
270+
Remove-MgUser -UserId $User.Id
271271
```
272272
273273
## Next steps

0 commit comments

Comments
 (0)