@@ -6,7 +6,7 @@ author: rolyon
6
6
manager : amycolannino
7
7
8
8
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
10
10
ms.topic : tutorial
11
11
ms.workload : identity
12
12
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
54
54
1 . In Azure Cloud Shell, create a password that complies with your password complexity requirements.
55
55
56
56
``` azurepowershell
57
- $PasswordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
58
- $PasswordProfile.Password = "Password"
57
+ $PasswordProfile = @{ Password = "<Password>" }
59
58
```
60
59
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.
62
61
63
62
```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"
66
65
```
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]
72
71
```
73
72
74
73
## Create a resource group
@@ -264,10 +263,11 @@ To clean up the resources created by this tutorial, delete the resource group an
264
263
265
264
1. When asked to confirm, type **Y**. It will take a few seconds to delete.
266
265
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.
268
267
269
268
```azurepowershell
270
- Remove-AzureADUser -ObjectId "[email protected] "
269
+ $User = Get-MgUser -Filter "DisplayName eq 'RBAC Tutorial User'"
270
+ Remove-MgUser -UserId $User.Id
271
271
```
272
272
273
273
## Next steps
0 commit comments