powershell: get scep status from sccm 2012 (sql? )


I would like to query (via powershell)sccm or sql behind sccm the overall health of antivirus in a domain.
F.e.: 90 percent of clients have recent virus update (definition xyz), y number has definition older then a week,z pcs are infected etc.

The data is there in sccm and reportingserver but how can I retrieve this via Powershell?
Goal is to present this in a simple kpi dashboard, together with other figures.
Really prefer Powershell since it is most flexible vs Sql report of which my knowledge is basic.


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rich WeisslerProfessional Troublemaker^h^h^h^h^hshooterCommented:
Confirm -- you want to get the data from the "Antimalware overall status and history" report in SCCM?  (Or is it one of the other related reports?)
Rich WeisslerProfessional Troublemaker^h^h^h^h^hshooterCommented:
Unfortunately I don't see a native SCCM Cmdlet to get what I think you want to display.

Since you said it was a SQL Report, the answer really doesn't change.  You can navigate thru the SQL Report server, and select the report you want to pull the data from.  If you don't wish to use the ReportServer front end for your dashboard, you can download the report definition... and even without the tool, the RDL file is just XML.  You can search for "CommandText", which will give you the various queries run from the database to generate the report.

Once you have those, you can invoke sql commands from powershell easily enough.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.