Forum Discussion
mattias-skog
Feb 26, 2023Iron Contributor
How do I create a roster plan?
Hello everyone! There are instructions on Microsoft Learn website on how to add remembers to roster plans, and how to remove members, but how do you actually create a roster plan? Access Microsof...
JohnMoore33
Mar 02, 2023Brass Contributor
Here my notes from investigating and testing this earlier. Hope it helps.
Microsoft has changed this by using Roster Containers:
- https://m365admin.handsontek.net/planners-new-roster-containers/
- This is managed via Graph APIs
- Roster: is the "security container" that holds the members and plans
- First create a Roster then create a Plan adding it to the Roster
- Creator of the Roster is automatically member.
- Additional Members to the Roster can be added via the Planner Web-UI
Planner Roster APIs:
https://learn.microsoft.com/en-us/graph/api/planner-post-rosters?view=graph-rest-beta&tabs=http
Create Roster
POST https://graph.microsoft.com/beta/planner/rosters
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.plannerRoster"
}Create Plan in Roster
You need to follow the documentation to create a Roster, then you can create a Plan by calling a POST to beta/planner/plans with a request body like this:
{
"container": {
"@odata.type": "microsoft.graph.plannerPlanContainer",
"containerId": "{RosterID}",
"type": "roster"
},
"title": "My Roster"
}
Testing
Use the https://developer.microsoft.com/en-us/graph/graph-explorer to test
Utalising Power Platform
Power Automate can be used to build a solution to create rosters (while waiting for MS to create UI options in planner)
- https://support.newoldstamp.com/en/articles/5967487-how-to-register-the-microsoft-graph-app-on-microsoft-azure-active-directory (needed for the Flow to access graph
- Create a List in SharePoint for requesting new Rosters (Plan Name, and owner of Plan)
- Create a Power Automate Flow when new list item is created, to create a roster (using APIs above) and create a plan in the Roster and adding the owner as member (https://michelcarlo.com/2021/09/04/creating-planner-plans-using-power-automate/ using the above APIs)
Check if roster is enabled via Powershell
- It is by default
- https://learn.microsoft.com/en-us/office365/planner/prerequisites-for-powershell
- Get-PlannerConfiguration
Piyush_Mistry
Dec 11, 2023Copper Contributor
JohnMoore33 Thanks for the info this was very helpful! I used your info to convert this into a set of PowerShell commands for anyone to try:
#Import Modules if needed
Import-Module Microsoft.Graph.Beta.Planner
#Connect to Graph with your credentials
Connect-MgGraph -Scopes "Tasks.ReadWrite"
#Capture Name of Planner
$Title = Read-Host -Prompt 'What is the Roster Plan name?'
$params = @{
"@odata.type" = "#microsoft.graph.plannerRoster"
}
#Save to variable to capture containerID for later
$ContainerID = New-MgBetaPlannerRoster -BodyParameter $params
$params = @{
container = @{
"@odata.type" = "microsoft.graph.plannerPlanContainer"
#Use saved ContainerID
"containerId" = $ContainerID.Id
"type" = "roster"
}
title = $Title
}
New-MgBetaPlannerPlan -BodyParameter $params