In this Azure article, we will discuss the syntax and usage of the Remove-AzADGroup PowerShell command with examples.
This command helps you to remove the entity from the Azure AD groups.
Below is the syntax of the Remove-AzADGroup PowerShell command.
Remove-AzADGroup -ObjectId <String>
Remove-AzADGroup -DisplayName <String>
You can execute the below PowerShell command to remove the entity from the Azure AD group with the display name DemoGroup.
Remove-AzADGroup -DisplayName DemoGroup
After executing the above PowerShell command, the Azure AD group with the display name DemoGroup has been deleted sucessfully.
To cross check, I reran the above PowerShell command and this time it says “Group with display name ‘DemoGroup’ does not exist” and means the Azure AD group has been deleted successfully.
Check out the same output here as below.
You can execute the below command which will delete the Azure AD group with the Object ID 6472abc0-dcaf-4739-b1ed-24f043d5227d.
Remove-AzADGroup -ObjectId 6472abc0-dcaf-4739-b1ed-24f043d5227d
After executing the above PowerShell command, the Azure AD group with the object ID 6472abc0-dcaf-4739-b1ed-24f043d5227d has been deleted successfully. Check out the below screenshot for your reference.
Check out the below Video tutorial on the Remove-AzADGroup PowerShell Command.
You can use the Get-AzADGroup PowerShell command to get the lists of Azure AD groups you have created already.
In this Azure PowerShell article, we discussed the syntax and usage of the Remove-AzADGroup PowerShell command with examples. Thanks for reading this article !!!
I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.