I would like to create a new Planner plan programmatically with PowerShell. Which permissions do I need? I am already a global admin. I received this error:
New-MgPlannerPlan_Create: C:\PS\Diversen\CreatePlannerPlan.ps1:13:5
Line |
13 | $plan = New-MgPlannerPlan -BodyParameter $params
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You do not have the required permissions to access this item, or the item may not exist. Status: 403 (Forbidden)
Connect-MgGraph
$groupid = "someGUID"
$planName = "someName"
$params = @{
container = @{
url = "https://graph.microsoft.com/v1.0/groups/$groupid"
}
title = $planName
}
try {
$plan = New-MgPlannerPlan -BodyParameter $params
}
catch {
write-error "Could not create the plan. Error:`n $_"
exit
}