Skip to content

Commit d2b11b4

Browse files
authored
Update troubleshoot-user-creation-deletion-issues.md
1 parent 890e88f commit d2b11b4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,20 @@ For example, if you want to delete a user who has a principal name of `NewUser@c
137137
DELETE https://graph.microsoft.com/v1.0/users/[email protected]
138138
```
139139

140-
## [Azure PowerShell](#tab/azure-powershell)
140+
## 【Microsoft Graph PowerShell](#tab/azure-powershell)
141141

142-
To delete a user in Azure PowerShell, run the [Remove-AzureADUser](/powershell/module/azuread/remove-azureaduser) cmdlet:
142+
To delete a user in Azure PowerShell, run the [Remove-MgUser](/powershell/module/microsoft.graph.users/remove-mguser?view=graph-powershell-1.0&preserve-view=true) cmdlet. To run this command, you must connect to Microsoft Graph with at least the `User.DeleteRestore.All` permission.
143143

144144
```powershell-interactive
145-
Remove-AzureADUser -ObjectId "<[email protected]>"
145+
Remove-MgUser -UserId '5c442efb-5e66-484a-936a-91b6810bed14'
146146
```
147147

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

150150
To delete a user in Azure CLI, run the [az ad user delete](/cli/azure/ad/user#az-ad-user-delete) command:
151151

152152
```azurecli-interactive
153+
Connect-MgGraph -Scopes "`User.DeleteRestore.All"
153154
az ad user delete --id "<[email protected]>"
154155
```
155156

0 commit comments

Comments
 (0)