%3CLINGO-SUB%20id%3D%22lingo-sub-1334456%22%20slang%3D%22en-US%22%3EUse%20CMPivot%20to%20gather%20troubleshooting%20data%20from%20remote%20clients%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1334456%22%20slang%3D%22en-US%22%3E%3CP%3EWith%20the%20current%20transition%20to%20remote%20working%2C%20most%20of%20our%20IT%20professionals%20have%20sought%20guidance%20on%20managing%20and%20securing%20devices%20while%20away%20from%20the%20corporate%20network.%20Many%20Configuration%20Manager%20administrators%20have%20followed%20our%20recommended%20guidance%20and%20shifted%2C%20or%20are%20in%20the%20process%20of%20shifting%2C%20device%20and%20endpoint%20management%20from%20on-premises%20to%20the%20internet%20by%20leveraging%20the%20cloud%20management%20gateway%20(CMG)%20scenario.%20If%20you%20already%20done%20so%2C%20follow%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fconfiguration-manager-blog%2Fmanaging-remote-machines-with-cloud-management-gateway-in%2Fba-p%2F1233895%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Ethis%20blog%20post%20for%20guidance%20on%20CMG%20deployment%3C%2FA%3E%20and%20the%20%26nbsp%3Bprescriptive%20guidance%20in%20this%20blog%20post%20for%20patching%20devices%20off%20the%20corporate%20network.%20For%20more%20information%2C%20see%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fconfigmgr%2Fcore%2Fclients%2Fmanage%2Fcmg%2Fplan-cloud-management-gateway%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPlan%20for%20the%20cloud%20management%20gateway%20article%3C%2FA%3E%20in%20the%20Configuration%20Manager%20documentation.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOur%20customers%20have%20also%20been%20asking%20us%20for%20guidance%20about%20troubleshooting%20and%20supporting%20these%20devices%20since%20common%20built-in%20tools%20such%20as%20the%20Computer%20Management%20console%2C%20PowerShell%20remoting%2C%20and%20WBEMTEST%20aren%E2%80%99t%20viable%20in%20these%20scenarios.%20%26nbsp%3BThis%20blog%20post%20shows%20examples%20of%20CMPivot%20queries%20for%20gathering%20troubleshooting%20data.%20These%20queries%20can%20gather%20real-time%20results%20for%20clients%20that%20are%20communicating%20with%20your%20new%20cloud%20management%20gateway.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWhat%20is%20CMPivot%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fconfigmgr%2Fcore%2Fservers%2Fmanage%2Fcmpivot%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECMPivot%20is%20an%20in-console%20utility%20introduced%20in%20Configuration%20Manager%20version%201806%3C%2FA%3E%20that%20provides%20access%20to%20the%20real-time%20state%20of%20devices%20in%20your%20environment.%20It%20immediately%20runs%20a%20query%20on%20all%20currently%20connected%20devices%20in%20the%20target%20collection%20and%20returns%20the%20results.%20You%20can%20then%20filter%20and%20group%20this%20data%20from%20within%20the%20tool.%20By%20providing%20real-time%20data%20from%20online%20clients%2C%20you%20can%20quickly%20answer%20business%20questions%2C%20troubleshoot%20issues%2C%20and%20respond%20to%20security%20incidents.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20use%20CMPivot%2C%20open%20the%20%3CSTRONG%3EConfiguration%20Manager%20console%3C%2FSTRONG%3E%20and%20navigate%20to%20the%20%3CSTRONG%3EAssets%20and%20Compliance%3C%2FSTRONG%3E%20workspace.%20Expand%20the%20%3CSTRONG%3EDevice%20Collections%3C%2FSTRONG%3E%20node%20and%20select%20a%20collection%20that%20contains%20your%20CMG%20Clients.%20Click%20%3CSTRONG%3EStart%20CMPivot%3C%2FSTRONG%3E%20in%20the%20ribbon%20to%20launch%20the%20tool.%20In%20the%20example%20below%2C%20a%20collection%20has%20been%20created%20called%20%3CSTRONG%3ECMG%20Clients%3C%2FSTRONG%3E%20which%20contains%20devices%20that%20are%20communicating%20with%20the%20CMG.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Scenario1.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186372iD0BC989C35555BF2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Scenario1.png%22%20alt%3D%22Scenario1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20CMPivot%20launches%2C%20you%20have%20the%20ability%20to%20perform%20a%20series%20of%26nbsp%3Bqueries%20on%20your%20clients%20to%20get%20the%20current%20status%20and%20health%2C%20including%20clients%20connecting%20through%20your%20CMG.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Scenario2.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186400iF1B9075E20329780%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Scenario2.png%22%20alt%3D%22Scenario2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EQuerying%20clients%20with%20CMPivot%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBelow%20are%20some%20commonly%20used%20queries%20that%20can%20help%20keep%20track%20of%20your%20remotely%20connected%20clients.%20For%20each%20of%20the%20examples%2C%20copy%20the%20query%20and%20paste%20it%20into%20CMPivot.%20Once%20the%20query%20is%20in%20CMPivot%2C%20click%20%3CSTRONG%3ERun%20Query%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%201%3A%20Review%20the%20management%20point%20configuration%20from%20cloud%20managed%20clients%3C%2FSTRONG%3E%3CSTRONG%3E.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThe%20first%20example%20shows%20which%20management%20points%20the%20clients%20are%20configured%20to%20use.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3ESMSAdvancedClientSSLConfigurations%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Scenario0.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186383i3934D635F115A448%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Scenario0.png%22%20alt%3D%22Scenario0.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%202%3A%20Review%20client%20services.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThe%20second%20example%20shows%20how%20to%20view%20%26nbsp%3Ba%20count%20of%20services%20that%20are%20currently%20stopped%20for%20each%20device%20in%20the%20collection.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EService%0A%7C%20summarize%20countif(%20(State%20%3D%3D%20'Stopped')%20)%20by%20Device%0A%7C%20where%20(countif_%20%26gt%3B%200)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Scenario3.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186399iF7A1052AF572ACB7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Scenario3.png%22%20alt%3D%22Scenario3.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%20can%20see%20in%20this%20example%20it%20has%20returned%20the%20number%20of%20services%20that%20are%20currently%20stopped%20on%20the%20%22CMG%20clients%22%20collection.%20Let%E2%80%99s%20continue%20to%20enhance%20the%20query%20and%20add%20some%20more%20criteria%20to%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%203%3A%20Reviewing%20the%20state%20of%20services%20from%20a%20specific%20device.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThe%20third%20example%20shows%20the%20state%20of%20the%20various%20services%20on%20a%20specific%20device.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EService%0A%7C%20where%20(State%20%3D%3D%20'Stopped')%0A%7C%20where%20(Device%20%3D%3D%20'catlab02')%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Scenario4.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186384i599C9D3795707BB2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Scenario4.png%22%20alt%3D%22Scenario4.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%20can%20see%20the%20results%20display%20services%20that%20are%20stopped%20from%20the%20catlab02%20Windows%2010%20client%20which%20is%20currently%20communicating%20with%20the%20cloud%20management%20gateway.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%204%3A%20Enhance%20the%20query%20with%20additional%20criteria.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EIn%20the%20fourth%20example%2C%20we%20enhance%20the%20query%20by%20narrowing%20it%20down%20to%20services%20starting%20with%20the%20letter%20%3CSTRONG%3EA%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EService%0A%7C%20where%20(State%20%3D%3D%20'Stopped')%0A%7C%20where%20(Device%20%3D%3D%20'catlab02')%0A%7C%20where%20Name%20startswith%20'a'%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Scenario5.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186397iE000E2157E08CB93%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Scenario5.png%22%20alt%3D%22Scenario5.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%20can%20see%20now%2C%20the%20services%20that%20start%20with%20letter%20%22A%22%20are%20displayed%20from%20the%20catlab02%20Windows%2010%20client.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%205%3A%20Recently%20used%20apps%20with%20chart%20rendering%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EHere%20is%20an%20example%20of%20a%20query%20that%20can%20be%20used%20one%20these%20clients%20to%20inventory%20recently%20used%20apps.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3ECCMRecentlyUsedApplications%0A%7C%20summarize%20dcount(%20device%20)%20by%20ProductName%0A%7C%20render%20columnchart%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Scenario6.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186396iEDA559A45B03331D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Scenario6.png%22%20alt%3D%22Scenario6.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20following%20results%20display%20the%20recently%20used%20app%20inventory.%20The%20light%20blue%20is%20stored%20data%20and%20the%20dark%20blue%20is%20the%20real-time%20data.%20This%20allows%20you%20to%20see%20the%20data%20quickly%20and%20also%20see%20data%20for%20devices%20that%20might%20currently%20be%20off-line.%20You%20can%20use%20operators%2C%20such%20as%20%3CSTRONG%3ETop%20(10)%3C%2FSTRONG%3E%20and%20%3CSTRONG%3ERender%3C%2FSTRONG%3E%20too.%20CMPivot%20uses%20a%20subset%20of%20the%20Kusto%20query%20language%20which%20is%20documented%20.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%206%3A%20Query%20application%20crashes%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThe%20following%20returns%20a%20list%20of%20application%20crashes%20from%20our%20example%20CMG%20collection.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EAppCrash%20%7C%20summarize%20dcount(%20Device%20)%20by%20FileName%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Scenario7.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186387i4D08E37BC6E91DE3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Scenario7.png%22%20alt%3D%22Scenario7.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%20can%20see%20from%20the%20example%20results%2C%20CMPivot%20returns%20applications%20that%20are%20crashing%20and%20the%20number%20devices%20with%20the%20crash.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%207%3A%20Missing%20software%20updates%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EIn%20this%20next%20example%20we%20will%20review%20the%20current%20list%20of%20updates%20that%20are%20applicable%20but%20not%20installed%20on%20the%20specific%20device.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3ESoftwareUpdate%20%7C%20where%20(Device%20%3D%3D%20'catlab02')%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Scenario8.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186388i1B47436EAAB7567E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Scenario8.png%22%20alt%3D%22Scenario8.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20example%20updates%20missing%20from%20the%20device%20are%20displayed.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%208%3A%20File%20inventory%20and%20summarization%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThis%20next%20example%20summarizes%20a%20file%20from%20the%20devices%20in%20the%20collection%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EFile('%25windir%25%5C%5Cnotepad.exe')%0A%7C%20summarize%20count()%20by%20Version%2C%20MD5Hash%0A%7C%20order%20by%20count_%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorSteve%20Thomas%20(GLADIATOR)_8%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Scenario9.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186395i5CBFF87952218D5D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Scenario9.png%22%20alt%3D%22Scenario9.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20example%20the%20query%20filters%20the%20results%20and%20presents%20us%20with%20a%20count%20of%20Notepad.exe%20from%20all%20the%20devices.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%209%3A%20Render%20data%20into%20a%20bar%20chart%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EIn%20this%20example%20we%20will%20render%20one%20of%20the%20queries%20into%20a%20bar%20chart.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EDevice%20%7C%20summarize%20dcount(Device)%20by%20Manufacturer%20%7Crender%20barchart%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Scenario10.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186394i1A462D9B3BDD8E15%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Scenario10.png%22%20alt%3D%22Scenario10.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20the%20data%20gets%20rendered%2C%20it%E2%80%99s%20easier%20to%20evaluate%20the%20data%20by%20visualizing%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExample%2010%3A%20Render%20data%20into%20a%20pie%20chart%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EIn%20this%20example%20we%20will%20render%20out%20a%20query%20to%20a%20pie%20chart.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Scenario11.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186398iFEA9084E6519E6E8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Scenario11.png%22%20alt%3D%22Scenario11.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%20%20%20%20OS%20%7C%20where%20(Version%20like%20'10%25')%20%7C%20summarize%20dcount(Device)%20by%20Version%20%7C%20render%20piechart%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%E2%80%99d%20like%20to%20understand%20more%20about%20rendering%2C%20check%20out%20the%20following%20%3CA%20href%3D%22https%3A%2F%2Fgallery.technet.microsoft.com%2FInfographic-Get-real-time-d43a084e%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Einfographic%3C%2FA%3E%20in%20the%20TechNet%20Gallery.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESummary%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3ECMPivot%20can%20be%20leveraged%20as%20a%20very%20powerful%20tool%20for%20immediate%20troubleshooting%20of%20clients.%20When%20combined%20with%20a%20cloud%20management%20gateway%2C%20CMPivot%20has%20great%20potential%20for%20use%20in%20work-from-home%20scenarios%20for%20corporate%20devices.%20The%20examples%20provided%20in%20this%20post%20help%20you%20get%20started%20with%20the%20most%20common%20queries.%20It%E2%80%99s%20important%20to%20note%20that%20queries%20might%20be%20delayed%20during%20a%20query%20as%20the%20data%20travels%20from%20the%20CMG%20to%20Configuration%20Manager.%20You%20might%20notice%20a%20small%20delay%20in%20comparison%20to%20a%20traditional%20query%20performed%20on%20the%20internal%20corporate%20network.%3C%2FP%3E%0A%3CP%3EYou%20are%20also%20welcome%20to%20share%20any%20helpful%20queries%20you%20might%20be%20using%20for%20troubleshooting%20in%20the%20comments%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESpecial%20thanks%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F73716%22%20target%3D%22_blank%22%3E%40Santos%20Martinez%3C%2FA%3E%26nbsp%3Bfor%20his%20technical%20expertise.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1334456%22%20slang%3D%22en-US%22%3E%3CP%3EOur%20customers%20have%20been%20asking%20us%20for%20guidance%20about%20troubleshooting%20and%20supporting%20these%20devices%20since%20common%20built-in%20tools%20such%20as%20the%20Computer%20Management%20console%2C%20PowerShell%20remoting%2C%20and%20WBEMTEST%20aren%E2%80%99t%20viable%20in%20these%20scenarios.%20%26nbsp%3BThis%20blog%20post%20shows%20examples%20of%20CMPivot%20queries%20for%20gathering%20troubleshooting%20data.%20These%20queries%20can%20gather%20real-time%20results%20for%20clients%20that%20are%20communicating%20with%20your%20new%20cloud%20management%20gateway.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1334456%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EReal-time%20Management%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1340546%22%20slang%3D%22en-US%22%3ERe%3A%20Use%20CMPivot%20to%20gather%20troubleshooting%20data%20from%20remote%20clients%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1340546%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20is%20very%20helpful%20and%20productive.%3C%2FP%3E%0A%3CP%3EFor%20future%2C%20it%20would%20have%20been%20nice%20to%20have%20some%20direct%20integration%20with%20Power%20BI.%3C%2FP%3E%0A%3CP%3EOne%20trick%20%2C%20I%20normally%20do%20is%20connecting%20Configuration%20Manager%20DB%20to%20Power%20BI%20and%20create%20some%20Query%20there%20and%20represent%20them%20with%20nice%20Power%20BI%20graph.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E

With the current transition to remote working, most of our IT professionals have sought guidance on managing and securing devices while away from the corporate network. Many Configuration Manager administrators have followed our recommended guidance and shifted, or are in the process of shifting, device and endpoint management from on-premises to the internet by leveraging the cloud management gateway (CMG) scenario. If you already done so, follow this blog post for guidance on CMG deployment and the  prescriptive guidance in this blog post for patching devices off the corporate network. For more information, see the Plan for the cloud management gateway article in the Configuration Manager documentation.

 

Our customers have also been asking us for guidance about troubleshooting and supporting these devices since common built-in tools such as the Computer Management console, PowerShell remoting, and WBEMTEST aren’t viable in these scenarios.  This blog post shows examples of CMPivot queries for gathering troubleshooting data. These queries can gather real-time results for clients that are communicating with your new cloud management gateway.

 

What is CMPivot?

CMPivot is an in-console utility introduced in Configuration Manager version 1806 that provides access to the real-time state of devices in your environment. It immediately runs a query on all currently connected devices in the target collection and returns the results. You can then filter and group this data from within the tool. By providing real-time data from online clients, you can quickly answer business questions, troubleshoot issues, and respond to security incidents.

 

To use CMPivot, open the Configuration Manager console and navigate to the Assets and Compliance workspace. Expand the Device Collections node and select a collection that contains your CMG Clients. Click Start CMPivot in the ribbon to launch the tool. In the example below, a collection has been created called CMG Clients which contains devices that are communicating with the CMG.

 

Scenario1.png

 

Once CMPivot launches, you have the ability to perform a series of queries on your clients to get the current status and health, including clients connecting through your CMG.

 

Scenario2.png

 

Querying clients with CMPivot

 

Below are some commonly used queries that can help keep track of your remotely connected clients. For each of the examples, copy the query and paste it into CMPivot. Once the query is in CMPivot, click Run Query.

 

Example 1: Review the management point configuration from cloud managed clients.

The first example shows which management points the clients are configured to use.

 

 

SMSAdvancedClientSSLConfigurations

 

 Scenario0.png

 

Example 2: Review client services.

The second example shows how to view  a count of services that are currently stopped for each device in the collection.

 

 

Service
| summarize countif( (State == 'Stopped') ) by Device
| where (countif_ > 0)

 

 

Scenario3.png

 

As you can see in this example it has returned the number of services that are currently stopped on the "CMG clients" collection. Let’s continue to enhance the query and add some more criteria to it.

 

Example 3: Reviewing the state of services from a specific device.

The third example shows the state of the various services on a specific device.

 

 

Service
| where (State == 'Stopped')
| where (Device == 'catlab02')

 

 

 

Scenario4.png

 

As you can see the results display services that are stopped from the catlab02 Windows 10 client which is currently communicating with the cloud management gateway.

 

Example 4: Enhance the query with additional criteria.

In the fourth example, we enhance the query by narrowing it down to services starting with the letter A.

 

 

Service
| where (State == 'Stopped')
| where (Device == 'catlab02')
| where Name startswith 'a'

 

 

Scenario5.png

 

As you can see now, the services that start with letter "A" are displayed from the catlab02 Windows 10 client.

 

Example 5: Recently used apps with chart rendering

Here is an example of a query that can be used one these clients to inventory recently used apps.

 

 

CCMRecentlyUsedApplications
| summarize dcount( device ) by ProductName
| render columnchart

 

 

Scenario6.png

 

The following results display the recently used app inventory. The light blue is stored data and the dark blue is the real-time data. This allows you to see the data quickly and also see data for devices that might currently be off-line. You can use operators, such as Top (10) and Render too. CMPivot uses a subset of the Kusto query language which is documented .

 

Example 6: Query application crashes

The following returns a list of application crashes from our example CMG collection.

 

 

AppCrash | summarize dcount( Device ) by FileName

 

 

Scenario7.png

 

As you can see from the example results, CMPivot returns applications that are crashing and the number devices with the crash.

 

Example 7: Missing software updates

In this next example we will review the current list of updates that are applicable but not installed on the specific device.

 

 

SoftwareUpdate | where (Device == 'catlab02')

 

 

Scenario8.png

 

In this example updates missing from the device are displayed.

 

Example 8: File inventory and summarization

This next example summarizes a file from the devices in the collection

 

 

File('%windir%\\notepad.exe')
| summarize count() by Version, MD5Hash
| order by count_

 

 

Scenario9.png

 

In this example the query filters the results and presents us with a count of Notepad.exe from all the devices.

 

Example 9: Render data into a bar chart

In this example we will render one of the queries into a bar chart.

 

 

Device | summarize dcount(Device) by Manufacturer |render barchart

 

 

Scenario10.png

 

Once the data gets rendered, it’s easier to evaluate the data by visualizing it.

 

Example 10: Render data into a pie chart

In this example we will render out a query to a pie chart.

 

Scenario11.png

 

 

    OS | where (Version like '10%') | summarize dcount(Device) by Version | render piechart

 

 

If you’d like to understand more about rendering, check out the following infographic in the TechNet Gallery.

 

Summary

CMPivot can be leveraged as a very powerful tool for immediate troubleshooting of clients. When combined with a cloud management gateway, CMPivot has great potential for use in work-from-home scenarios for corporate devices. The examples provided in this post help you get started with the most common queries. It’s important to note that queries might be delayed during a query as the data travels from the CMG to Configuration Manager. You might notice a small delay in comparison to a traditional query performed on the internal corporate network.

You are also welcome to share any helpful queries you might be using for troubleshooting in the comments below.

 

Special thanks to @Santos Martinez for his technical expertise.

 

1 Comment
Valued Contributor

This is very helpful and productive.

For future, it would have been nice to have some direct integration with Power BI.

One trick , I normally do is connecting Configuration Manager DB to Power BI and create some Query there and represent them with nice Power BI graph.