Last active
April 24, 2020 00:20
-
-
Save JeffBrownTech/d48c81efe3760a745bf2b717b329a494 to your computer and use it in GitHub Desktop.
Create Graph API Request to make an M365 Group
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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