Skip to content

Commit 6035bff

Browse files
Merge pull request #265134 from TimShererWithAquent/graphps38
Bulk update | 174285 MS Graph PowerShell cmdlet update Phase 3
2 parents d68bbfe + 906deb1 commit 6035bff

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

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

Lines changed: 14 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.date: 02/02/2019
1212
ms.author: rolyon
@@ -34,6 +34,7 @@ To complete this tutorial, you will need:
3434

3535
- Permissions to create users in Microsoft Entra ID (or have an existing user)
3636
- [Azure Cloud Shell](../cloud-shell/quickstart-powershell.md)
37+
- [Microsoft Graph PowerShell SDK](/powershell/microsoftgraph/installation)
3738

3839
## Role assignments
3940

@@ -53,21 +54,20 @@ To assign a role, you need a user, group, or service principal. If you don't alr
5354
1. In Azure Cloud Shell, create a password that complies with your password complexity requirements.
5455

5556
```azurepowershell
56-
$PasswordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
57-
$PasswordProfile.Password = "Password"
57+
$PasswordProfile = @{ Password = "<Password>" }
5858
```
5959
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.
6161
6262
```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"
6565
```
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]
7171
```
7272
7373
## Create a resource group
@@ -263,10 +263,11 @@ To clean up the resources created by this tutorial, delete the resource group an
263263
264264
1. When asked to confirm, type **Y**. It will take a few seconds to delete.
265265
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.
267267
268268
```azurepowershell
269-
Remove-AzureADUser -ObjectId "[email protected]"
269+
$User = Get-MgUser -Filter "DisplayName eq 'RBAC Tutorial User'"
270+
Remove-MgUser -UserId $User.Id
270271
```
271272
272273
## Next steps

0 commit comments

Comments
 (0)