@@ -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.date : 02/02/2019
12
12
ms.author : rolyon
@@ -34,6 +34,7 @@ To complete this tutorial, you will need:
34
34
35
35
- Permissions to create users in Microsoft Entra ID (or have an existing user)
36
36
- [ Azure Cloud Shell] ( ../cloud-shell/quickstart-powershell.md )
37
+ - [ Microsoft Graph PowerShell SDK] ( /powershell/microsoftgraph/installation )
37
38
38
39
## Role assignments
39
40
@@ -53,21 +54,20 @@ To assign a role, you need a user, group, or service principal. If you don't alr
53
54
1 . In Azure Cloud Shell, create a password that complies with your password complexity requirements.
54
55
55
56
``` azurepowershell
56
- $PasswordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
57
- $PasswordProfile.Password = "Password"
57
+ $PasswordProfile = @{ Password = "<Password>" }
58
58
```
59
59
60
- 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.
61
61
62
62
```azurepowershell
63
- New-AzureADUser -DisplayName "RBAC Tutorial User" -PasswordProfile $PasswordProfile `
64
- -UserPrincipalName "[email protected] " -AccountEnabled $true -MailNickName "rbacuser"
63
+ New-MgUser -DisplayName "RBAC Tutorial User" -PasswordProfile $PasswordProfile `
64
+ -UserPrincipalName "[email protected] " -AccountEnabled: $true -MailNickName "rbacuser"
65
65
```
66
-
67
- ```Example
68
- ObjectId DisplayName UserPrincipalName UserType
69
- -------- ----------- ----------------- --------
70
- 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]
71
71
```
72
72
73
73
## Create a resource group
@@ -263,10 +263,11 @@ To clean up the resources created by this tutorial, delete the resource group an
263
263
264
264
1. When asked to confirm, type **Y**. It will take a few seconds to delete.
265
265
266
- 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.
267
267
268
268
```azurepowershell
269
- Remove-AzureADUser -ObjectId "[email protected] "
269
+ $User = Get-MgUser -Filter "DisplayName eq 'RBAC Tutorial User'"
270
+ Remove-MgUser -UserId $User.Id
270
271
```
271
272
272
273
## Next steps
0 commit comments