powershell script for azure AD group creation

Copper Contributor

Hi ..


I looking for a help in making a script to create a group in Azure Active Directory.

1 Reply

Hi @Srini1987 ,


This used to be more complicated in the past (calling MS Graph API via Invoke-RestMethod or similar), but now with AzureAD PowerShell module, you can simply use a single cmdlet for that - New-AzureADGroup.


More info here: https://docs.microsoft.com/en-us/powershell/module/azuread/new-azureadgroup?view=azureadps-2.0


You would need to authenticate to AAD first using Connect-AzureAD cmdlet. Depending on whether you want to use an interactive logon (you interacting with the script from a console) or have it as an automated background task, you would need to read more details about it here: https://docs.microsoft.com/en-us/powershell/module/AzureAD/Connect-AzureAD?view=azureadps-2.0