-2

Could you advise how could I run query ID using command prompt? For example, I do not want to go to Monitoring-Queries-expand tree and search for the specific querry. I Just want to have script file, when I launch it the command show the result of my query or export it to csv file. What is the syntaxis if I should go to File - connect via Windows Poweshell?

MS SCCM 2012 console version 5 site version 5

  • Your question's 'Title' should contain the question. The info in your title should be in the body. I think you are asking "How do I monitor queries in SCCM using Powershell?" – Xalorous May 11 '17 at 16:07
2

Do you mean that you want to use PowerShell to run a CM Query? Then you can use built-in cmdlet:

Invoke-CMQuery -Name 'YourQueryName'

To get the detailed syntax of Invoke-CMQuery command, you can run below:

Get-Help Invoke-CMQuery

The output is different with running from GUI, however, you may still be able to use PowerShell to change the output style.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.