Skip to content

Instantly share code, notes, and snippets.

@JeffBrownTech
Last active April 24, 2020 00:20
Show Gist options
  • Save JeffBrownTech/d48c81efe3760a745bf2b717b329a494 to your computer and use it in GitHub Desktop.
Save JeffBrownTech/d48c81efe3760a745bf2b717b329a494 to your computer and use it in GitHub Desktop.
Create Graph API Request to make an M365 Group
# Create group request body
$groupBody =
'{
"displayName": "Team from Graph API Demo",
"mailNickname": "teamfromgraphapidemo",
"description": "Demo making a group from Graph API",
"[email protected]": [
"https://graph.microsoft.com/v1.0/users/{id}" # Use object ID or UPN of user
],
"groupTypes": [
"Unified"
],
"mailEnabled": "true",
"securityEnabled": "false",
"visibility": "Private"
}'
$newGroup = Invoke-RestMethod -Uri "https://graph.microsoft.com/v1.0/groups" -Method POST -Headers $headers -Body $groupBody
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment