Forum Discussion
How do I create a roster plan?
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
- Piyush_MistryDec 12, 2023Copper Contributor
Anton Dorfmann - Do you mean after you create both the Planner Roster, and subsequent plan in PowerShell you don't see it in the Planner web UI?
You should be able to find it by going to M365 >> Planner >> Hub (Menu) >> at the bottom switch from 'Recent' >> 'All'.
Don't try finding it on the left menu by selecting 'Show more' as it only shows some of the most recent plans you've used and since these are new plans it will likely not show if you have too many.
- Anton DorfmannDec 12, 2023Copper ContributorHi Piyush_Mistry, ok, my fail was that i did not create asubsequent plan inside the Roster. Do i need to create the plan with this command New-MgBetaPlannerPlan ?
thank you- Piyush_MistryDec 12, 2023Copper Contributor
Anton Dorfmann - Correct! Creating a PlannerRoster on its own just creates a group of users in the M365 ether
. This link details that if a plannerRoster is not joined to a plannerPlan within 24hrs of creation, MS deletes the roster:
https://learn.microsoft.com/en-us/graph/api/resources/plannerroster?view=graph-rest-beta#:~:text=A%20plannerRoster%20will%20also%20be%20automatically%20deleted%20under%20the%20following%20conditions%3A