Through ProvisionPoint API you can change the Service Definition that is linked to your workspace.
Changing the workspace will allow you to change
- The lifecycle policy applied,
- Actions that are available and
- The metadata (Forms & Columns)
- Change Compliance management
- Splitting Internal and External items
- You have changed the service Type in Microsoft (Teams site no group to be Group connected)
- A new version of the Service Definition has been created
Whatever the need, use the API to achieve the goal.
This article presumes the API has been setup and that you know how to connect to the API using PowerShell 7.
If you do not read ProvisionPoint API & Setup & Connect to ProvisionPoint API using PowerShell 7
Example scripts are available in the ProvisionPoint API Examples
Service Definition Configuration
- Find the ServiceInstanceId of the workspaces to update, read How to find the ServiceInstanceId for a Workspace
- Check the Forms that are linked to the Service Definition, any mandatory columns added to the form will need to be included in the Body.
- Ensure the API Group has requestor permissions on the new Service Definition
- We support changing Service types from a Site Collection to Teams, Viva Engage Communities, M365 Groups, Planners. It cannot be used in the opposite way.
- The new URL for the new type will need to be created, for example, Viva Engage Urls, Planner Urls or Group URLs. If you are re-linking from a non-group related site collection to a modern Team Site a Group will be required.
Get the GroupId from Entra, open the Group and take the GUID from the end of the URL
API Endpoint for Change Service Definition
To run an the Change Service Definition through the API, use the PUT method and the endpoint is required.
The endpoint is made up of
API Body
Create an array for the Body provide the details required
$ChangeSD = @{
ServiceInstanceId = $ServiceInstanceId
ServiceDefinitionName = "SD name it will be moved to"
#Metadata = $Metadata
#GroupId = "insert group Id if Group was added"
#PlanId = ""
#PlannerUrl = ""
#YammerGroupId = ""
#YammerUrl = ""
}
If there is a Form linked to the Service Definition, any required fields should also be added as an Array & the body should be uncommented to use the variable.
Below is an example using PowerShell7 to collect from a CSV file
$FormColumns = @(
@{
Name = "Business Unit"
},
@{
Name = "Site ID"
IsNumber = $true
},
@{
Name = "Department"
}
)
$Metadata = @()
if($FormColumns -ne $null){
$FormColumns | ForEach-Object -Process {
$FormColumnName = $_.Name
$Value = $SiteRow.$FormColumnName
if ($_.IsMUltiple){
$Value = Get-PPAsArray $Value
}
$Metadata += Get-PPAsMetadataItem -FieldName $FormColumnName -FieldValue $Value -AsNumber:$_.IsNumber -AsBoolean:$_.IsBoolean
}
}
Once the script is configured, run this to change the Service Definition