question

muditbahedia avatar image
0 Votes"
muditbahedia asked muditbahedia answered

Powershell cmdlet for SCCM throwing error when executing from ServiceNow but working directly from SCCM server

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.

Troubleshooting done:
Tried storing resource id as [int] and [string] both, but it still gave above error.

Any idea what can be causing this?

mem-cm-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

FionaYan-MSFT avatar image
0 Votes"
FionaYan-MSFT answered

@muditbahedia

Thank you for posting in Microsoft Q&A forum.

From your description, your question is more trend towards to the servicenow direction.We believe that the support engineer of the servicenow may have more resource to help us with our issue.I suggest you to the servicenow community so that engineer of servicenow will help you solve this issue in a more efficient way. Thank you for your understanding.

To obtain the path of servicenow community,please take a look at the web site listed below:
https://community.servicenow.com/community


Thank you very much for your kind understanding.

Have a nice day!


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

muditbahedia avatar image
0 Votes"
muditbahedia answered

We were able to figure this out.
While using above cmdlet, device wasn't in limit collection.
Once we solved it, the cmdlet was being executed fine.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.