cmdlet: Add-CMDeviceCollectionDirectMembershipRule -CollectionId $CollectionID -ResourceId $rid
When I run above cmdlet from ServiceNow, it gives error: "The specified resource Id '12345678' is of the wrong type."
But when I run the same cmdlet directly against SCCM, it adds resource successfully to collection.
Tried storing resource id as [int] and [string] both, but it still gave above error.
Any idea what can be causing this?