Automate Patching on SCCM using WMI classes of AdminService API?

Joshi, Guru Raja - Dell Team 1 Reputation point
2022-12-15T13:47:36.723+00:00

Hi Team,

How to utilize below mentioned SMS_CM_UpdatePackages class methods when we use AdminService API?

Let's take an example, SMS_CM_UpdatePackages having 4 methods
1.IsCurrentWorkingUpdatePackage
2. RetryContentReplication
3. SetIgnorePrereqWarning
4. UpdatePrereqAndStateFlags

https://<ServerName>/AdminService/wmi/SMS_CM_UpdatePackages

Please help us.

Thanks in advance.

Microsoft Security | Intune | Configuration Manager | Other
Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Limitless Technology 44,751 Reputation points
    2022-12-16T08:56:28.53+00:00

    Hi,

    Thank you for posting your query.

    Kindly follow the steps provided below to resolve your issue.

    Configuration Manager uses the administration service REST API in several native scenarios. You can also use the administration service for your own custom scenarios.

    Note

    The examples in this article all use the FQDN of the server that hosts the SMS Provider role. If you access the administration service remotely through a CMG, use the CMG endpoint instead of the SMS Provider FQDN. For more information, see Enable internet access

    Go to this link for your reference and other troubleshooting procedures https://learn.microsoft.com/en-us/mem/configmgr/develop/adminservice/usage

    Do not hesitate to message us if you need further assistance.

    If the answer is helpful kindly click "Accept as Answer" and up vote it.

    0 comments No comments

  2. AllenLiu-MSFT 49,311 Reputation points Microsoft External Staff
    2022-12-19T03:01:08.32+00:00

    Hi, @Joshi, Guru Raja - Dell Team

    Thank you for posting in Microsoft Q&A forum.

    Here are the methods in the SMS_CM_UpdatePackages class, you may click each method to see the Syntax:
    https://learn.microsoft.com/en-us/mem/configmgr/develop/reference/sum/sms_cm_updatepackages-server-wmi-class#methods


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.


  3. Joshi, Guru Raja - Dell Team 1 Reputation point
    2022-12-27T06:08:48.64+00:00

    Hi Team,

    I'm stuck on below mentioned API, I have created CollectionRule using SMS_CollectionRule Class but after creating we need to add to collection for membership.

    https://<ServerName>/AdminService/wmi/SMS_Collection.AddMembershipRule

    SInt32 AddMembershipRule(
    SMS_CollectionRule collectionRule,
    UInt32 QueryID
    );

    Let me know how to pass CollectionRule object to this API. Please provide some example.
    Thanks in advance

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.