SOLVED

Windows update query

%3CLINGO-SUB%20id%3D%22lingo-sub-773008%22%20slang%3D%22en-US%22%3EWindows%20update%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773008%22%20slang%3D%22en-US%22%3E%3CP%3EHi.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20to%20see%20the%20total%20missing%20updates%20pr%20%22server%22%20in%20a%20column.%20I%20have%20one%20query%20but%20it%20count%20wrong%20%3A(%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20my%20query%20that%20i%20use%20right%20now%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EUpdateSummary%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%26gt%3Bago%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E12%3C%2FSPAN%3E%3CSPAN%3Eh%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Esummarize%3C%2FSPAN%3E%3CSPAN%3Eany%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ESourceComputerId%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3Eany%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ESourceComputerId%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3Eby%3C%2FSPAN%3E%3CSPAN%3ESourceComputerId%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ejoin%3C%2FSPAN%3E%3CSPAN%3Ekind%3Dleftouter%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E(%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EUpdate%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%26gt%3Bago%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E14%3C%2FSPAN%3E%3CSPAN%3Eh%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3EOSType!%3D%3C%2FSPAN%3E%3CSPAN%3E%22Linux%22%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3ESourceComputerId%20in%20%3C%2FSPAN%3E%3CSPAN%3E((%3C%2FSPAN%3E%3CSPAN%3EHeartbeat%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%26gt%3Bago%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E12%3C%2FSPAN%3E%3CSPAN%3Eh%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3EOSType%3D~%3C%2FSPAN%3E%3CSPAN%3E%22Windows%22%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3Enotempty%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EComputer%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Esummarize%3C%2FSPAN%3E%3CSPAN%3Earg_max%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3ESolutions%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3Eby%3C%2FSPAN%3E%3CSPAN%3ESourceComputerId%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3ESolutions%20%3C%2FSPAN%3E%3CSPAN%3Ehas%3C%2FSPAN%3E%3CSPAN%3E%22updates%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Edistinct%3C%2FSPAN%3E%3CSPAN%3ESourceComputerId%3C%2FSPAN%3E%3CSPAN%3E))%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Esummarize%3C%2FSPAN%3E%3CSPAN%3Ehint%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3Estrategy%3Dpartitioned%20arg_max%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EUpdateState%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EClassification%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3ETitle%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EOptional%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EApproved%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EComputer%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EComputerEnvironment%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3Eby%3C%2FSPAN%3E%3CSPAN%3EComputer%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3ESourceComputerId%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EUpdateID%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Esummarize%3C%2FSPAN%3E%3CSPAN%3EComputer%3Dany%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EComputer%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3EComputerEnvironment%3Dany%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EComputerEnvironment%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3EmissingCriticalUpdatesCount%3Dcountif%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EClassification%20%3C%2FSPAN%3E%3CSPAN%3Ehas%3C%2FSPAN%3E%3CSPAN%3E%22Critical%22%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3EUpdateState%3D~%3C%2FSPAN%3E%3CSPAN%3E%22Needed%22%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3EApproved!%3D%3C%2FSPAN%3E%3CSPAN%3Efalse%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3EmissingSecurityUpdatesCount%3Dcountif%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EClassification%20%3C%2FSPAN%3E%3CSPAN%3Ehas%3C%2FSPAN%3E%3CSPAN%3E%22Security%22%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3EUpdateState%3D~%3C%2FSPAN%3E%3CSPAN%3E%22Needed%22%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3EApproved!%3D%3C%2FSPAN%3E%3CSPAN%3Efalse%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3EmissingOtherUpdatesCount%3Dcountif%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EClassification%20!%3C%2FSPAN%3E%3CSPAN%3Ehas%3C%2FSPAN%3E%3CSPAN%3E%22Critical%22%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3EClassification%20!%3C%2FSPAN%3E%3CSPAN%3Ehas%3C%2FSPAN%3E%3CSPAN%3E%22Security%22%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3EUpdateState%3D~%3C%2FSPAN%3E%3CSPAN%3E%22Needed%22%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3EOptional%3D%3D%3C%2FSPAN%3E%3CSPAN%3Efalse%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3EApproved!%3D%3C%2FSPAN%3E%3CSPAN%3Efalse%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3ElastAssessedTime%3Dmax%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3ElastUpdateAgentSeenTime%3D%3C%2FSPAN%3E%3CSPAN%3E%22%22%3C%2FSPAN%3E%3CSPAN%3Eby%3C%2FSPAN%3E%3CSPAN%3ESourceComputerId%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Eextend%3C%2FSPAN%3E%3CSPAN%3Ecompliance%3Diff%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EmissingCriticalUpdatesCount%20%26gt%3B%20%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3Eor%3C%2FSPAN%3E%3CSPAN%3EmissingSecurityUpdatesCount%20%26gt%3B%20%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E2%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Eextend%3C%2FSPAN%3E%3CSPAN%3EComplianceOrder%3Diff%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EmissingCriticalUpdatesCount%20%26gt%3B%20%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3Eor%3C%2FSPAN%3E%3CSPAN%3EmissingSecurityUpdatesCount%20%26gt%3B%20%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3Eor%3C%2FSPAN%3E%3CSPAN%3EmissingOtherUpdatesCount%20%26gt%3B%20%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E3%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eon%3C%2FSPAN%3E%3CSPAN%3ESourceComputerId%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Eproject%3C%2FSPAN%3E%3CSPAN%3EdisplayName%3DComputer%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EmissingCriticalUpdatesCount%3Dcoalesce%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EmissingCriticalUpdatesCount%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3EmissingSecurityUpdatesCount%3Dcoalesce%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EmissingSecurityUpdatesCount%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3EmissingOtherUpdatesCount%3Dcoalesce%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EmissingOtherUpdatesCount%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E-%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E)%2C%3C%2FSPAN%3E%3CSPAN%3EComplianceOrder%3Dcoalesce%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EComplianceOrder%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E2%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Eorder%3C%2FSPAN%3E%3CSPAN%3Eby%3C%2FSPAN%3E%3CSPAN%3EComplianceOrder%20asc%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EmissingCriticalUpdatesCount%20desc%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EmissingSecurityUpdatesCount%20desc%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EmissingOtherUpdatesCount%20desc%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3EdisplayName%20asc%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Eproject-away%3C%2FSPAN%3E%3CSPAN%3EComplianceOrder%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EAny%20help%20is%20appreciated%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2FDennis%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-773008%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EQuery%20Language%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-773107%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20update%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773107%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F381915%22%20target%3D%22_blank%22%3E%40Dennis_Vind_Nielsen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECan%20you%20give%20us%20a%20clue%20to%20where%20you%20think%20the%20error%20is%3F%26nbsp%3B%20%26nbsp%3B%20What%20count%20is%20wrong%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20two%20main%20queries%20you%20see%20on%20the%20Update%20Management%20Dashboard%20are%20here%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Security-Center%2Fblob%2Fmaster%2FLegacy%2520Log%2520Analytics%2520dashboards%2FNotableEventsQueries.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FAzure%2FAzure-Security-Center%2Fblob%2Fmaster%2FLegacy%2520Log%2520Analytics%2520dashboards%2FNotableEventsQueries.md%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%2F%2F%20compliant%0AUpdate%20%0A%7C%20where%20UpdateState%20!%3D%20%22Needed%22%20%20and%20(Classification%20%3D%3D%20%22Security%20Updates%22%20or%20Classification%20%3D%3D%20%22Critical%20Updates%22)%0A%7C%20distinct%20%20Computer%0A%7C%20count%0A%20%0A%2F%2F%20non-compliant%0AUpdate%20%0A%7C%20where%20UpdateState%20%3D%3D%20%22Needed%22%20%20and%20(Classification%20%3D%3D%20%22Security%20Updates%22%20or%20Classification%20%3D%3D%20%22Critical%20Updates%22)%0A%7C%20summarize%20count()%20by%20Computer%0A%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20have%20the%20'not%20assessed'%20one%20as%20well.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-773464%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20update%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773464%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239477%22%20target%3D%22_blank%22%3E%40Clive%20Watson%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eyour%20query%20is%20the%20first....%20mine%20the%20second%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20283px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F124483i7058012BE2C6F27E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Annotation%202019-07-25%20152628.jpg%22%20title%3D%22Annotation%202019-07-25%20152628.jpg%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20833px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F124484i26EE7B3F0D66BE9C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Annotation%202019-07-25%20152816.jpg%22%20title%3D%22Annotation%202019-07-25%20152816.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-773527%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20update%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773527%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F381915%22%20target%3D%22_blank%22%3E%40Dennis_Vind_Nielsen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20would%20assume%20that%20you%20have%20taken%20that%20query%20from%20Update%20Management.%20They%20are%20doing%20some%20more%20complex%20calculation%20like%20if%20the%20server%20is%20up%2C%20etc.%20because%20of%20that%20their%20query%20is%20very%20complex.%20I%20would%20assume%20you%20want%20a%20little%20bit%20more%20simplified%20one.%20The%20below%20one%20is%20the%20simplest%20I%20could%20build.%20Let%20me%20know%20if%20it%20works%20for%20you%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%7C%20summarize%20arg_max(TimeGenerated%2C%20*)%20by%20Computer%2C%20Title%2C%20Classification%2C%20UpdateID%0A%7C%20where%20UpdateState%20%3D%3D%20%22Needed%22%20%0A%7C%20summarize%20MissingUpdatesCount%20%3D%20count()%20by%20Computer%20%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3BI%20just%20saw%20that%20someone%20else%20started%20to%20respond%20on%20this%20thread%20so%20apologies%20that%20I%20am%20interfering%20in%20the%20thread.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774586%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20update%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774586%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9172%22%20target%3D%22_blank%22%3E%40Stanislav%20Zhelyazkov%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks...%20Nice%20simple%20query%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774606%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20update%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774606%22%20slang%3D%22en-US%22%3EIf%20i%20want%20to%20have%20%22last%20Update%20Time%22%20as%20well%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774621%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20update%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774621%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F381915%22%20target%3D%22_blank%22%3E%40Dennis_Vind_Nielsen%3C%2FA%3EJust%20to%20clarify%20by%20%22last%20Update%20Time%22%20you%20mean%20the%20last%20time%20of%20when%20the%20scan%20was%20performed%20by%20Update%20Management%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774675%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20update%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774675%22%20slang%3D%22en-US%22%3ENo%2C%20i%20ment%20the%20LastUpdateApplied%20date%3A)%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774690%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20update%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774690%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F381915%22%20target%3D%22_blank%22%3E%40Dennis_Vind_Nielsen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENot%20sure%20how%20accurate%20is%20UpdateSummary%20table%20but%20here%20you%20go%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Elet%20summary%20%3D%20UpdateSummary%0A%7C%20summarize%20arg_max(TimeGenerated%2C%20*)%20by%20Computer%0A%7C%20project%20Computer%2C%20LastUpdateApplied%3B%0AUpdate%0A%7C%20summarize%20arg_max(TimeGenerated%2C%20*)%20by%20Computer%2C%20Title%2C%20Classification%2C%20UpdateID%0A%7C%20where%20UpdateState%20%3D%3D%20%22Needed%22%20%20%0A%7C%20summarize%20MissingUpdatesCount%20%3D%20count()%20by%20Computer%20%0A%7C%20join%20(%0A%20%20%20%20summary%0A)%20on%20Computer%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774706%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20update%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774706%22%20slang%3D%22en-US%22%3EWorked%20really%20fine%3A)Thanks%20a%20lot%3CBR%20%2F%3E%3CBR%20%2F%3ECan%20you%20for%20format%20the%20LastUpdateApplied%20to%20MM-dd-yyyy%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774712%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20update%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774712%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F381915%22%20target%3D%22_blank%22%3E%40Dennis_Vind_Nielsen%3C%2FA%3ESure%3C%2FP%3E%0A%3CP%3EThese%20small%20things%20you%20should%20try%20doing%20in%20your%20own%20though%20as%20it%20will%20help%20you%20in%20long%20term%20building%20Kusto%20queries.%20If%20you%20search%20in%20google%3A%20'Kusto%20format%20date'%20you%20will%20click%20on%20the%20first%20result%2C%20look%20at%20the%20example%20and%20implement%20it.%20These%20small%20operators%20are%20easy%20to%20implement.%20Here%20is%20the%20query%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Elet%20summary%20%3D%20UpdateSummary%0A%7C%20summarize%20arg_max(TimeGenerated%2C%20*)%20by%20Computer%0A%7C%20project%20Computer%2C%20format_datetime(LastUpdateApplied%2C%20'MM-dd-yyyy%20')%3B%0AUpdate%0A%7C%20summarize%20arg_max(TimeGenerated%2C%20*)%20by%20Computer%2C%20Title%2C%20Classification%2C%20UpdateID%0A%7C%20where%20UpdateState%20%3D%3D%20%22Needed%22%20%20%0A%7C%20summarize%20MissingUpdatesCount%20%3D%20count()%20by%20Computer%20%0A%7C%20join%20(%0A%20%20%20%20summary%0A)%20on%20Computer%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774719%22%20slang%3D%22en-US%22%3ERe%3A%20Windows%20update%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774719%22%20slang%3D%22en-US%22%3EYou%20are%20the%20king%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hi.

 

I would like to see the total missing updates pr "server" in a column. I have one query but it count wrong :(

 

This is my query that i use right now

 

UpdateSummary
| where TimeGenerated>ago(12h)
| summarize any(SourceComputerId), any(SourceComputerId) by SourceComputerId
| join kind=leftouter
(
Update
| where TimeGenerated>ago(14h) and OSType!="Linux" and SourceComputerId in ((Heartbeat
| where TimeGenerated>ago(12h) and OSType=~"Windows" and notempty(Computer)
| summarize arg_max(TimeGenerated, Solutions) by SourceComputerId
| where Solutions has "updates"
| distinct SourceComputerId))
| summarize hint.strategy=partitioned arg_max(TimeGenerated, UpdateState, Classification, Title, Optional, Approved, Computer, ComputerEnvironment) by Computer, SourceComputerId, UpdateID
| summarize Computer=any(Computer), ComputerEnvironment=any(ComputerEnvironment), missingCriticalUpdatesCount=countif(Classification has "Critical" and UpdateState=~"Needed" and Approved!=false), missingSecurityUpdatesCount=countif(Classification has "Security" and UpdateState=~"Needed" and Approved!=false), missingOtherUpdatesCount=countif(Classification !has "Critical" and Classification !has "Security" and UpdateState=~"Needed" and Optional==false and Approved!=false), lastAssessedTime=max(TimeGenerated), lastUpdateAgentSeenTime="" by SourceComputerId
| extend compliance=iff(missingCriticalUpdatesCount > 0 or missingSecurityUpdatesCount > 0, 2, 1)
| extend ComplianceOrder=iff(missingCriticalUpdatesCount > 0 or missingSecurityUpdatesCount > 0 or missingOtherUpdatesCount > 0, 1, 3)
)
on SourceComputerId
| project displayName=Computer, missingCriticalUpdatesCount=coalesce(missingCriticalUpdatesCount, -1), missingSecurityUpdatesCount=coalesce(missingSecurityUpdatesCount, -1), missingOtherUpdatesCount=coalesce(missingOtherUpdatesCount, -1), ComplianceOrder=coalesce(ComplianceOrder, 2)
| order by ComplianceOrder asc, missingCriticalUpdatesCount desc, missingSecurityUpdatesCount desc, missingOtherUpdatesCount desc, displayName asc
| project-away ComplianceOrder
 
 
Any help is appreciated
 
/Dennis 
11 Replies
Highlighted

@Dennis_Vind_Nielsen 

 

Can you give us a clue to where you think the error is?    What count is wrong?

 

The two main queries you see on the Update Management Dashboard are here:

https://github.com/Azure/Azure-Security-Center/blob/master/Legacy%20Log%20Analytics%20dashboards/Not... 

 

// compliant
Update 
| where UpdateState != "Needed"  and (Classification == "Security Updates" or Classification == "Critical Updates")
| distinct  Computer
| count
 
// non-compliant
Update 
| where UpdateState == "Needed"  and (Classification == "Security Updates" or Classification == "Critical Updates")
| summarize count() by Computer

 

I have the 'not assessed' one as well.

Highlighted

@Clive Watson 

your query is the first.... mine the second

Annotation 2019-07-25 152628.jpgAnnotation 2019-07-25 152816.jpg

Highlighted
Solution

Hi@Dennis_Vind_Nielsen 

I would assume that you have taken that query from Update Management. They are doing some more complex calculation like if the server is up, etc. because of that their query is very complex. I would assume you want a little bit more simplified one. The below one is the simplest I could build. Let me know if it works for you:

 

 
Update
| summarize arg_max(TimeGenerated, *) by Computer, Title, Classification, UpdateID
| where UpdateState == "Needed" 
| summarize MissingUpdatesCount = count() by Computer 
 

 I just saw that someone else started to respond on this thread so apologies that I am interfering in the thread.

Highlighted

@Stanislav Zhelyazkov 

 

Thanks... Nice simple query

Highlighted
If i want to have "last Update Time" as well?
Highlighted

@Dennis_Vind_Nielsen Just to clarify by "last Update Time" you mean the last time of when the scan was performed by Update Management?

Highlighted
No, i ment the LastUpdateApplied date :)
Highlighted

@Dennis_Vind_Nielsen 

 

Not sure how accurate is UpdateSummary table but here you go:

let summary = UpdateSummary
| summarize arg_max(TimeGenerated, *) by Computer
| project Computer, LastUpdateApplied;
Update
| summarize arg_max(TimeGenerated, *) by Computer, Title, Classification, UpdateID
| where UpdateState == "Needed"  
| summarize MissingUpdatesCount = count() by Computer 
| join (
    summary
) on Computer
Highlighted
Worked really fine :) Thanks a lot

Can you for format the LastUpdateApplied to MM-dd-yyyy
Highlighted

@Dennis_Vind_Nielsen Sure

These small things you should try doing in your own though as it will help you in long term building Kusto queries. If you search in google: 'Kusto format date' you will click on the first result, look at the example and implement it. These small operators are easy to implement. Here is the query:

let summary = UpdateSummary
| summarize arg_max(TimeGenerated, *) by Computer
| project Computer, format_datetime(LastUpdateApplied, 'MM-dd-yyyy ');
Update
| summarize arg_max(TimeGenerated, *) by Computer, Title, Classification, UpdateID
| where UpdateState == "Needed"  
| summarize MissingUpdatesCount = count() by Computer 
| join (
    summary
) on Computer
Highlighted
You are the king

Thanks