web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Create AAD Security Group Teams using PowerShell

(0) ShareShare
ReportReport
Posted on by 5

hello,

Looking for sample scripts on how to create "AAD Security Group Teams" using PowerShell - Dynamics 365 online.

Thanks.

I have the same question (0)
  • Linn Zaw Win Profile Picture
    3,407 on at

    I believe you have to create the team record and associate with the security role using Microsoft.Xrm.Data.PowerShell or CURL Command to Dynamics 365 API.

    The sample codes can be found below.

    https://github.com/seanmcne/Microsoft.Xrm.Data.PowerShell

    http://rest-examples.chilkat.io/dynamics_crm/powershell/default.cshtml

  • Saad Khamis Profile Picture
    5 on at

    Thank you.

    I have been using "Microsoft.Xrm.Data.PowerShell" module for awhile.

    I'm able to create "Owner" teams and assigning security roles to existing Teams.

    The challenge I have is with creating AAD Security Teams because of the attribute types.

    e.g. I don't know how to set teamtype (Edm.Int32) to 2 (AAD Security Group). The type of it is Emd.Int32, so I cannot set it to just 2 (int) or "2" (string).

    That is why I'm looking for sample code to show me how to do it.

  • Linn Zaw Win Profile Picture
    3,407 on at

    I am afraid there might not be the sample code for the exact requirement as yours since not a lot of people create records using "Microsoft.Xrm.Data.PowerShell" module and document their code. Normally if we set the value for the option set field in JavaScript, C# or flow, we would only use the integer value. So, please try just 2 (int).

  • Suggested answer
    Tad Okada Profile Picture
    Microsoft Employee on at

    Hi Saad,

    Have you checked the docs below?

    https://docs.microsoft.com/en-us/azure/active-directory/users-groups-roles/groups-settings-v2-cmdlets#create-groups

    It contains an example command to create a group.

    If it's helpful then I'm happy.

    Thanks, Tad

  • Saad Khamis Profile Picture
    5 on at

    Thank you for your suggestion.

    This document explains how to create "Azure Active Directory Group" not "Dynamic 365 Online AAD Security Group Teams".

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 176

#2
ManoVerse Profile Picture

ManoVerse 56 Super User 2026 Season 1

#3
Niki Patel Profile Picture

Niki Patel 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans