Trigger CMPivot remotely using WMI and Powershell

DS 51 Reputation points
2020-09-18T17:38:00.8+00:00

Hi,

As CMPivot is also listed as one of default CMScript, I was just exploring option to trigger it via server WMI class using Powershell.

Classes being referred:

  1. SMS_Scripts
  2. SMS_ClientOperation

Method Name to trigger CMPivot as CMScript:

  1. InitiateClientOperationEx

While calling this method, one of the step includes specifying 'Argument' namse, if any, for the targeted script with its value. As the PS script is usually uploaded by us within CMScript, we are aware of the argument and the value it expects. In case of CMPivot, I was able to find the argument/parameter name it expects but not sure what values would go within it. Screenshot attached below:

25853-argument-names-for-cmpivot.jpg

I have checked the CMpivot related logs on the site server and client, by triggering some siple query using in-console CMPivot application, but it does not log these details.

Any suggestions?

Microsoft Configuration Manager Application
Microsoft Configuration Manager Application
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Application: A computer program designed to carry out a specific task other than one relating to the operation of the computer itself, typically to be used by end users.
467 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AllenLiu-MSFT 42,511 Reputation points Microsoft Vendor
    2020-09-21T06:44:16.873+00:00

    @DS
    Thank you for posting in Microsoft Q&A forum.
    Sorry, I'm not very familiar with the method InitiateClientOperationEx, however I found an article that tell us how to trigger CMPivot through the Cloud Management Gateway, you may check it to see if it helps:
    (Third-party article, just for your reference)
    https://www.asquaredozen.com/2019/06/18/configmgr-1906-technical-preview-testing-cmpivot-over-cmg-using-adminservice/


    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.

    0 comments No comments

  2. DS 51 Reputation points
    2020-09-21T15:47:36.387+00:00

    @ AllenLiu-MSFT

    Thank yo for your reply. Yes, I have seen this too. But just wanted to know if CMPivot could be trigerred via CMScript.