Forum Discussion
Martin_R_Sorensen
Jun 28, 2022Copper Contributor
AdminService add/delete rules in collection
Hi I'm trying to add and delete devices from a collection via AdminService on Configuration manager 2203 from PowerShell. When I try the below command I receive an error Invoke-RestMethod -Met...
Michael_Veniger
Dec 18, 2023Copper Contributor
Martin_R_Sorensen Hi Martin, you need to specify a proper body for this. Example:
$body =@'
{
"collectionRule":{
"@odata.type" : "#AdminService.SMS_CollectionRuleDirect",
"ResourceClassName": "SMS_R_System",
"ResourceID": 12345678,
"RuleName": "MyMachine"
}
}
'@