Skip to content

Commit 2e6e670

Browse files
authored
Update troubleshoot-user-creation-deletion-issues.md
1 parent 4abbb32 commit 2e6e670

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

support/entra/entra-id/dir-dmns-obj/troubleshoot-user-creation-deletion-issues.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,15 @@ Content-type: application/json {
7474
}
7575
```
7676

77-
## [Azure PowerShell](#tab/azure-powershell)
78-
79-
To add a user in Azure PowerShell, run the [New-AzureADUser](/powershell/module/azuread/new-azureaduser) cmdlet:
77+
## [Microsoft Graph PowerShell](#tab/azure-powershell)
8078

81-
[!INCLUDE [Azure AD PowerShell deprecation note](~/../support/reusable-content/msgraph-powershell/includes/aad-powershell-deprecation-note.md)]
79+
To add a user in Microsoft Graph PowerShell, run the [New-MgUser](/powershell/module/microsoft.graph.users/new-mguser?view=graph-powershell-1.0)) cmdlet:
8280

83-
```powershell-interactive
84-
$PasswordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
85-
$PasswordProfile.Password = "<Password>"
86-
New-AzureADUser -AccountEnabled $true `
87-
-DisplayName "<New User>" `
88-
-MailNickName "<Newuser>" `
89-
-PasswordProfile $PasswordProfile `
90-
-UserPrincipalName "<[email protected]>"
81+
```powershell
82+
$PasswordProfile = @{
83+
Password = 'xWwvJ]6NMw+bWH-d'
84+
}
85+
New-MgUser -DisplayName 'Rene Magi' -PasswordProfile $PasswordProfile -AccountEnabled -MailNickName 'ReneMagi' -UserPrincipalName '[email protected]'
9186
```
9287

9388
## [Azure CLI](#tab/azure-cli)

0 commit comments

Comments
 (0)