Fråga Uppdateringshanteringsloggar

Förutom den information som tillhandahålls under distributionen av uppdateringshantering kan du söka i loggarna som lagras på Log Analytics-arbetsytan. Om du vill söka i loggarna från ditt Automation-konto väljer du Uppdateringshantering och öppnar log analytics-arbetsytan som är associerad med distributionen.

Du kan också anpassa loggfrågorna eller använda dem från olika klienter. Mer information finns i dokumentationen för Api för Log Analytics-sökning.

Fråga efter uppdateringsposter

Uppdateringshantering samlar in poster för virtuella Windows- och Linux-datorer och de datatyper som visas i loggsökningsresultat. I följande avsnitt beskrivs dessa poster.

Frågeuppdateringspost

En post med en typ av Update skapas som representerar tillgängliga uppdateringar och deras installationsstatus för en dator. Dessa poster har egenskaperna i följande tabell:

Property Beskrivning
TenantId Unik identifierare som representerar din organisations instans av Microsoft Entra-ID.
SourceSystem Källsystemet för posten. Värdet är OperationsManager.
TimeGenerated Datum och tid då posten skapades.
SourceComputerId Unik identifierare som representerar källdatorn.
Title Uppdateringens titel.
Klassificering Godkännandeklassificering. Värdet är Uppdateringar.
PublishedDate (UTC) Det datum då uppdateringen är redo att laddas ned och installeras från Windows Update.
Dator Fullständigt kvalificerat domännamn för rapportdatorn.
UpdateState Uppdateringens aktuella tillstånd.
Produkt De produkter som uppdateringen gäller för.
OSType Typ av operativsystem. Värden är Windows eller Linux.
ProductVersion Version av uppdateringen.
Produktbåge Tillämplig datorarkitektur
CVENumbers Vanliga sårbarheter och exponeringar
BulletinUrl URL för bulletinen
BulletinID Bulletin-ID-nummer.
PackageRepository Lagringsplatsinformation för paketet.
PackageSeverity Allvarlighetsgraden för uppdateringen.
OSName Typ av operativsystem. Värden är Windows eller Linux.
OSVersion Versionen av operativsystemet.
OSFullName Namnet på operativsystemet.
SubscriptionId Unik identifierare för Azure-prenumerationen.
ResourceGroup Namnet på resursgruppen som resursen tillhör.
ResourceProvider Resursprovidern.
Resurs Namn på resursen.
ResourceId Unik identifierare för resursen som är associerad med posten.
ResourceType Resurstypen.
ComputerEnvironment Miljö. Möjliga värden är Azure eller icke-Azure.
VMUUID Unik identifierare för den virtuella datorn.
MG Unik identifierare för hanteringsgruppen eller Log Analytics-arbetsytan.
ManagementGroupName Namnet på Operations Manager-hanteringsgruppen eller Log Analytics-arbetsytan.
MSRCSeverity Allvarlighetsgrad för säkerhetsrisken. Värden är:
Kritiskt
Viktigt!
Medel
Lågt
KBID Kunskapsbasartikel-ID för Windows-uppdateringen.
UpdateID Unik identifierare för programuppdateringen.
RevisionNumber Revisionsnumret för en specifik revision av en uppdatering.
Valfri Sant om posten är valfri eller Falskt på annat sätt.
RebootBehavior Omstartsbeteendet efter installation/avinstallation av en uppdatering.
MSRCBulletinID Säkerhetsbulletinens ID-nummer.
Godkänt Sant om posten är godkänd eller Falskt på annat sätt.
ApprovalSource Gäller endast windowsoperativsystem. Källa för godkännande för posten. Värdet är Microsoft Update.
InstallTimePredictionSeconds
InstallTimeDeviationRangeSeconds
InstallTimeAvailable
Type Posttyp. Värdet är Uppdatera.

Post för distributionsstatus för frågeuppdatering

En post med en typ av UpdateRunProgress skapas som ger uppdateringsdistributionsstatus för en schemalagd distribution per dator. Dessa poster har egenskaperna i följande tabell:

Property Beskrivning
TenantId Unik identifierare som representerar din organisations instans av Microsoft Entra-ID.
SourceSystem Källsystem för posten. Värdet är OperationsManager.
TimeGenerated Datum och tid då posten skapades.
MG Unik identifierare för hanteringsgruppen eller Log Analytics-arbetsytan.
ManagementGroupName Namnet på Operations Manager-hanteringsgruppen eller Log Analytics-arbetsytan.
SourceComputerId Unik identifierare som representerar källdatorn.
KBID Kunskapsbasartikel-ID för Windows-uppdateringen.
UpdateId Unik identifierare för programuppdateringen.
SucceededOnRetry Värde som anger om uppdateringskörningen misslyckades vid det första försöket och den aktuella åtgärden är ett återförsök.
ErrorResult Windows Update-felkod genereras om en uppdatering inte kan installeras.
UpdateRunName Namnet på uppdateringsschemat.
InstallationStatus Möjliga installationstillstånd för en uppdatering på klientdatorn,
NotStarted - jobbet har inte utlösts än.
Failed – jobbet startades men misslyckades med ett undantag.
InProgress - pågående jobb.
MaintenanceWindowExceeded – om körningen var kvar men underhållsintervallet uppnåddes.
Succeeded - jobbet lyckades.
Install Failed – uppdateringen kunde inte installeras.
NotIncluded – motsvarande uppdateringsklassificering matchar inte kundens poster i indataklassificeringslistan.
Excluded – användaren anger ett KBID i undantagen lista. Om KBID i listan över undantagna matchar det identifierade uppdaterings-KB-ID:t under korrigeringen markeras det som exkluderat.
Dator Fullständigt kvalificerat domännamn för rapportdatorn.
Title Uppdateringens titel.
Produkt De produkter som uppdateringen gäller för.
OSType Typ av operativsystem. Värden är Windows eller Linux.
Starttid (UTC) Tid då uppdateringen är schemalagd att installeras. Den här egenskapen används för närvarande inte. Se TimeGenerated.
EndTime (UTC) Tiden då synkroniseringsprocessen avslutades. Den här egenskapen används för närvarande inte. Se TimeGenerated.
CorrelationId Unik identifierare för runbook-jobbkörningen för uppdateringen.
SubscriptionId Unik identifierare för Azure-prenumerationen.
ResourceGroup Namnet på resursgruppen som resursen tillhör.
ResourceProvider Resursprovidern.
Resurs Namn på resursen.
ResourceId Unik identifierare för resursen som är associerad med posten.
ResourceType Resurstyp.
ComputerEnvironment Miljö. Värden är Azure eller icke-Azure.
VMUUID Unik identifierare för den virtuella datorn.
Type Typ av uppdatering. Värdet är UpdateRunProgress.
_ResourceId Unik identifierare för resursen som är associerad med posten.

Sammanfattningspost för frågeuppdatering

En post med en typ av UpdateSummary skapas som ger uppdateringssammanfattning per dator. Dessa poster har egenskaperna i följande tabell:

Property Beskrivning
TenantId Unik identifierare som representerar din organisations instans av Microsoft Entra-ID.
SourceSystem Källsystem för posten. Värdet är OpsManager.
TimeGenerated Datum och tid då posten skapades.
MG Unik identifierare för hanteringsgruppen eller Log Analytics-arbetsytan.
ManagementGroupName Namnet på Operations Manager-hanteringsgruppen eller Log Analytics-arbetsytan.
SourceComputerId Unik identifierare för den virtuella datorn.
LastUpdateApplied (UTC)
OldestMissingSecurityUpdateInDays Totalt antal dagar för den äldsta uppdateringen som identifierats som tillämpligt och som inte har installerats.
OldestMissingSecurityUpdateBucket Specificerare för den äldsta säkerhets bucketen som saknas. Värden är:
Senaste om värdet är mindre än 30 dagar
30 dagar sedan
60 dagar sedan
90 dagar sedan
120 dagar sedan
150 dagar sedan
180 dagar sedan
Äldre när värdet är större än 180 dagar.
WindowsUpdateSetting Status för Windows Update-agenten. Möjliga värden är:
Scheduled installation
Notify before installation
Error returned from unhealthy WUA agent
WindowsUpdateAgentVersion Version av Windows Update-agenten.
WSUSServer Fel om Windows Update-agenten har ett problem för felsökning.
Dator Fullständigt kvalificerat domännamn för rapportdatorn.
OsVersion Versionen av operativsystemet.
NETRuntimeVersion Version av .NET Framework installerad på Windows-datorn.
CriticalUpdatesMissing Antal tillämpliga kritiska uppdateringar som saknas.
SecurityUpdatesMissing Antal säkerhetsuppdateringar som saknas.
OtherUpdatesMissing Antal identifierade uppdateringar som saknas.
TotalUpdatesMissing Totalt antal uppdateringar som saknas.
Omstart väntar Sant om en omstart väntar eller falskt på annat sätt.
SubscriptionId Unik identifierare för Azure-prenumerationen.
ResourceGroup Namnet på resursgruppen som innehåller resursen.
ResourceProvider Resursprovidern.
Resurs Namnet på resursen för posten.
ResourceId Unik identifierare för resursen som är associerad med posten.
ResourceType Resurstyp.
ComputerEnvironment Miljö. Värden är Azure eller icke-Azure.
VMUUID Unik identifierare för den virtuella datorn.
Type Posttyp. Värdet är UpdateSummary.
_ResourceId Unik identifierare för resursen som är associerad med posten.

Exempelfrågor

Följande avsnitt innehåller exempelloggfrågor för uppdateringsposter som samlas in för uppdateringshantering.

Bekräfta att icke-Azure-datorer är aktiverade för uppdateringshantering

Kontrollera att direktanslutna datorer kommunicerar med Azure Monitor-loggar genom att köra någon av följande loggsökningar.

Linux

Heartbeat
| where OSType == "Linux" | summarize arg_max(TimeGenerated, *) by SourceComputerId | top 500000 by Computer asc | render table

Windows

Heartbeat
| where OSType == "Windows" | summarize arg_max(TimeGenerated, *) by SourceComputerId | top 500000 by Computer asc | render table

På en Windows-dator kan du granska följande information för att verifiera agentanslutningen med Azure Monitor-loggar:

  1. Öppna Microsoft Monitoring Agent i Kontrollpanelen. På fliken Azure Log Analytics visar agenten följande meddelande: Microsoft Monitoring Agent har anslutits till Log Analytics.

  2. Öppna Windows-händelseloggen. Gå till Program- och tjänstloggar\Operations Manager och sök efter händelse-ID 3000 och händelse-ID 5002 från källtjänstens Anslut eller. Dessa händelser anger att datorn har registrerats på Log Analytics-arbetsytan och tar emot konfigurationen.

Om agenten inte kan kommunicera med Azure Monitor-loggar och agenten är konfigurerad för att kommunicera med Internet via en brandvägg eller proxyserver kontrollerar du att brandväggen eller proxyservern är korrekt konfigurerad. Information om hur du kontrollerar att brandväggen eller proxyservern är korrekt konfigurerad finns i Nätverkskonfiguration för Windows-agent eller Nätverkskonfiguration för Linux-agent.

Kommentar

Om dina Linux-system är konfigurerade för att kommunicera med en proxy eller Log Analytics Gateway och du aktiverar Uppdateringshantering uppdaterar du behörigheterna proxy.conf för att ge omiuser-gruppen läsbehörighet för filen med hjälp av följande kommandon:

sudo chown omsagent:omiusers /etc/opt/microsoft/omsagent/proxy.conf sudo chmod 644 /etc/opt/microsoft/omsagent/proxy.conf

Nyligen tillagda Linux-agenter visar statusen Uppdaterad efter att en utvärdering har utförts. Den här processen kan ta upp till 6 timmar.

Information om hur du bekräftar att en Operations Manager-hanteringsgrupp kommunicerar med Azure Monitor-loggar finns i Verifiera Operations Manager-integrering med Azure Monitor-loggar.

Utvärderingsfrågor för enskilda virtuella Azure-datorer (Windows)

Ersätt VMUUID-värdet med VM-GUID för den virtuella dator som du frågar efter. Du hittar VMUUID som ska användas genom att köra följande fråga i Azure Monitor-loggar: Update | where Computer == "<machine name>" | summarize by Computer, VMUUID

Sammanfattning av saknade uppdateringar

Update
| where TimeGenerated>ago(14h) and OSType!="Linux" and (Optional==false or Classification has "Critical" or Classification has "Security") and VMUUID=~"b08d5afa-1471-4b52-bd95-a44fea6e4ca8"
| summarize hint.strategy=partitioned arg_max(TimeGenerated, UpdateState, Classification, Approved) by Computer, SourceComputerId, UpdateID
| where UpdateState=~"Needed" and Approved!=false
| summarize by UpdateID, Classification
| summarize allUpdatesCount=count(), criticalUpdatesCount=countif(Classification has "Critical"), securityUpdatesCount=countif(Classification has "Security"), otherUpdatesCount=countif(Classification !has "Critical" and Classification !has "Security")

Uppdateringslista saknas

Update
| where TimeGenerated>ago(14h) and OSType!="Linux" and (Optional==false or Classification has "Critical" or Classification has "Security") and VMUUID=~"8bf1ccc6-b6d3-4a0b-a643-23f346dfdf82"
| summarize hint.strategy=partitioned arg_max(TimeGenerated, UpdateState, Classification, Title, KBID, PublishedDate, Approved) by Computer, SourceComputerId, UpdateID
| where UpdateState=~"Needed" and Approved!=false
| project-away UpdateState, Approved, TimeGenerated
| summarize computersCount=dcount(SourceComputerId, 2), displayName=any(Title), publishedDate=min(PublishedDate), ClassificationWeight=max(iff(Classification has "Critical", 4, iff(Classification has "Security", 2, 1))) by id=strcat(UpdateID, "_", KBID), classification=Classification, InformationId=strcat("KB", KBID), InformationUrl=iff(isnotempty(KBID), strcat("https://support.microsoft.com/kb/", KBID), ""), osType=2
| sort by ClassificationWeight desc, computersCount desc, displayName asc
| extend informationLink=(iff(isnotempty(InformationId) and isnotempty(InformationUrl), toobject(strcat('{ "uri": "', InformationUrl, '", "text": "', InformationId, '", "target": "blank" }')), toobject('')))
| project-away ClassificationWeight, InformationId, InformationUrl

Utvärderingsfrågor för enskilda virtuella Azure-datorer (Linux)

För vissa Linux-distributioner finns det ett slutmatchningsfel med VMUUID-värdet som kommer från Azure Resource Manager och vad som lagras i Azure Monitor-loggar. Följande fråga söker efter en matchning på endera endianness. Ersätt VMUUID-värdena med formatet big-endian och little-endian för GUID för att returnera resultatet korrekt. Du hittar VMUUID som ska användas genom att köra följande fråga i Azure Monitor-loggar: Update | where Computer == "<machine name>" | summarize by Computer, VMUUID

Sammanfattning av saknade uppdateringar

Update
| where TimeGenerated>ago(5h) and OSType=="Linux" and (VMUUID=~"625686a0-6d08-4810-aae9-a089e68d4911" or VMUUID=~"a0865662-086d-1048-aae9-a089e68d4911")
| summarize hint.strategy=partitioned arg_max(TimeGenerated, UpdateState, Classification) by Computer, SourceComputerId, Product, ProductArch
| where UpdateState=~"Needed"
| summarize by Product, ProductArch, Classification
| summarize allUpdatesCount=count(), criticalUpdatesCount=countif(Classification has "Critical"), securityUpdatesCount=countif(Classification has "Security"), otherUpdatesCount=countif(Classification !has "Critical" and Classification !has "Security")

Uppdateringslista saknas

Update
| where TimeGenerated>ago(5h) and OSType=="Linux" and (VMUUID=~"625686a0-6d08-4810-aae9-a089e68d4911" or VMUUID=~"a0865662-086d-1048-aae9-a089e68d4911")
| summarize hint.strategy=partitioned arg_max(TimeGenerated, UpdateState, Classification, BulletinUrl, BulletinID) by Computer, SourceComputerId, Product, ProductArch
| where UpdateState=~"Needed"
| project-away UpdateState, TimeGenerated
| summarize computersCount=dcount(SourceComputerId, 2), ClassificationWeight=max(iff(Classification has "Critical", 4, iff(Classification has "Security", 2, 1))) by id=strcat(Product, "_", ProductArch), displayName=Product, productArch=ProductArch, classification=Classification, InformationId=BulletinID, InformationUrl=tostring(split(BulletinUrl, ";", 0)[0]), osType=1
| sort by ClassificationWeight desc, computersCount desc, displayName asc
| extend informationLink=(iff(isnotempty(InformationId) and isnotempty(InformationUrl), toobject(strcat('{ "uri": "', InformationUrl, '", "text": "', InformationId, '", "target": "blank" }')), toobject('')))
| project-away ClassificationWeight, InformationId, InformationUrl

Utvärderingsfrågor för flera virtuella datorer

Sammanfattning av datorer

Heartbeat
| where TimeGenerated>ago(12h) and OSType=~"Windows" and notempty(Computer)
| summarize arg_max(TimeGenerated, Solutions) by SourceComputerId
| where Solutions has "updates"
| distinct SourceComputerId
| join kind=leftouter
(
    Update
    | where TimeGenerated>ago(14h) and OSType!="Linux"
    | summarize hint.strategy=partitioned arg_max(TimeGenerated, UpdateState, Approved, Optional, Classification) by SourceComputerId, UpdateID
    | distinct SourceComputerId, Classification, UpdateState, Approved, Optional
    | summarize WorstMissingUpdateSeverity=max(iff(UpdateState=~"Needed" and (Optional==false or Classification has "Critical" or Classification has "Security") and Approved!=false, iff(Classification has "Critical", 4, iff(Classification has "Security", 2, 1)), 0)) by SourceComputerId
)
on SourceComputerId
| extend WorstMissingUpdateSeverity=coalesce(WorstMissingUpdateSeverity, -1)
| summarize computersBySeverity=count() by WorstMissingUpdateSeverity
| union (Heartbeat
| where TimeGenerated>ago(12h) and OSType=="Linux" and notempty(Computer)
| summarize arg_max(TimeGenerated, Solutions) by SourceComputerId
| where Solutions has "updates"
| distinct SourceComputerId
| join kind=leftouter
(
    Update
    | where TimeGenerated>ago(5h) and OSType=="Linux"
    | summarize hint.strategy=partitioned arg_max(TimeGenerated, UpdateState, Classification) by SourceComputerId, Product, ProductArch
    | distinct SourceComputerId, Classification, UpdateState
    | summarize WorstMissingUpdateSeverity=max(iff(UpdateState=~"Needed", iff(Classification has "Critical", 4, iff(Classification has "Security", 2, 1)), 0)) by SourceComputerId
)
on SourceComputerId
| extend WorstMissingUpdateSeverity=coalesce(WorstMissingUpdateSeverity, -1)
| summarize computersBySeverity=count() by WorstMissingUpdateSeverity)
| summarize assessedComputersCount=sumif(computersBySeverity, WorstMissingUpdateSeverity>-1), notAssessedComputersCount=sumif(computersBySeverity, WorstMissingUpdateSeverity==-1), computersNeedCriticalUpdatesCount=sumif(computersBySeverity, WorstMissingUpdateSeverity==4), computersNeedSecurityUpdatesCount=sumif(computersBySeverity, WorstMissingUpdateSeverity==2), computersNeedOtherUpdatesCount=sumif(computersBySeverity, WorstMissingUpdateSeverity==1), upToDateComputersCount=sumif(computersBySeverity, WorstMissingUpdateSeverity==0)
| summarize assessedComputersCount=sum(assessedComputersCount), computersNeedCriticalUpdatesCount=sum(computersNeedCriticalUpdatesCount),  computersNeedSecurityUpdatesCount=sum(computersNeedSecurityUpdatesCount), computersNeedOtherUpdatesCount=sum(computersNeedOtherUpdatesCount), upToDateComputersCount=sum(upToDateComputersCount), notAssessedComputersCount=sum(notAssessedComputersCount)
| extend allComputersCount=assessedComputersCount+notAssessedComputersCount

Sammanfattning av saknade uppdateringar

Update
| where TimeGenerated>ago(5h) and OSType=="Linux" and SourceComputerId in ((Heartbeat
| where TimeGenerated>ago(12h) and OSType=="Linux" 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) by Computer, SourceComputerId, Product, ProductArch
| where UpdateState=~"Needed"
| summarize by Product, ProductArch, Classification
| union (Update
| where TimeGenerated>ago(14h) and OSType!="Linux" and (Optional==false or Classification has "Critical" or Classification has "Security") 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, Approved) by Computer, SourceComputerId, UpdateID
| where UpdateState=~"Needed" and Approved!=false
| summarize by UpdateID, Classification )
| summarize allUpdatesCount=count(), criticalUpdatesCount=countif(Classification has "Critical"), securityUpdatesCount=countif(Classification has "Security"), otherUpdatesCount=countif(Classification !has "Critical" and Classification !has "Security")

Lista över datorer

Heartbeat
| where TimeGenerated>ago(12h) and OSType=="Linux" and notempty(Computer)
| summarize arg_max(TimeGenerated, Solutions, Computer, ResourceId, ComputerEnvironment, VMUUID) by SourceComputerId
| where Solutions has "updates"
| extend vmuuId=VMUUID, azureResourceId=ResourceId, osType=1, environment=iff(ComputerEnvironment=~"Azure", 1, 2), scopedToUpdatesSolution=true, lastUpdateAgentSeenTime=""
| join kind=leftouter
(
    Update
    | where TimeGenerated>ago(5h) and OSType=="Linux" and SourceComputerId in ((Heartbeat
    | where TimeGenerated>ago(12h) and OSType=="Linux" 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, Product, Computer, ComputerEnvironment) by SourceComputerId, Product, ProductArch
    | summarize Computer=any(Computer), ComputerEnvironment=any(ComputerEnvironment), missingCriticalUpdatesCount=countif(Classification has "Critical" and UpdateState=~"Needed"), missingSecurityUpdatesCount=countif(Classification has "Security" and UpdateState=~"Needed"), missingOtherUpdatesCount=countif(Classification !has "Critical" and Classification !has "Security" and UpdateState=~"Needed"), 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 id=SourceComputerId, displayName=Computer, sourceComputerId=SourceComputerId, scopedToUpdatesSolution=true, missingCriticalUpdatesCount=coalesce(missingCriticalUpdatesCount, -1), missingSecurityUpdatesCount=coalesce(missingSecurityUpdatesCount, -1), missingOtherUpdatesCount=coalesce(missingOtherUpdatesCount, -1), compliance=coalesce(compliance, 4), lastAssessedTime, lastUpdateAgentSeenTime, osType=1, environment=iff(ComputerEnvironment=~"Azure", 1, 2), ComplianceOrder=coalesce(ComplianceOrder, 2)
| union(Heartbeat
| where TimeGenerated>ago(12h) and OSType=~"Windows" and notempty(Computer)
| summarize arg_max(TimeGenerated, Solutions, Computer, ResourceId, ComputerEnvironment, VMUUID) by SourceComputerId
| where Solutions has "updates"
| extend vmuuId=VMUUID, azureResourceId=ResourceId, osType=2, environment=iff(ComputerEnvironment=~"Azure", 1, 2), scopedToUpdatesSolution=true, lastUpdateAgentSeenTime=""
| 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 id=SourceComputerId, displayName=Computer, sourceComputerId=SourceComputerId, scopedToUpdatesSolution=true, missingCriticalUpdatesCount=coalesce(missingCriticalUpdatesCount, -1), missingSecurityUpdatesCount=coalesce(missingSecurityUpdatesCount, -1), missingOtherUpdatesCount=coalesce(missingOtherUpdatesCount, -1), compliance=coalesce(compliance, 4), lastAssessedTime, lastUpdateAgentSeenTime, osType=2, environment=iff(ComputerEnvironment=~"Azure", 1, 2), ComplianceOrder=coalesce(ComplianceOrder, 2) )
| order by ComplianceOrder asc, missingCriticalUpdatesCount desc, missingSecurityUpdatesCount desc, missingOtherUpdatesCount desc, displayName asc
| project-away ComplianceOrder

Uppdateringslista saknas

Update
| where TimeGenerated>ago(5h) and OSType=="Linux" and SourceComputerId in ((Heartbeat
| where TimeGenerated>ago(12h) and OSType=="Linux" 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, BulletinUrl, BulletinID) by SourceComputerId, Product, ProductArch
| where UpdateState=~"Needed"
| project-away UpdateState, TimeGenerated
| summarize computersCount=dcount(SourceComputerId, 2), ClassificationWeight=max(iff(Classification has "Critical", 4, iff(Classification has "Security", 2, 1))) by id=strcat(Product, "_", ProductArch), displayName=Product, productArch=ProductArch, classification=Classification, InformationId=BulletinID, InformationUrl=tostring(split(BulletinUrl, ";", 0)[0]), osType=1
| union(Update
| where TimeGenerated>ago(14h) and OSType!="Linux" and (Optional==false or Classification has "Critical" or Classification has "Security") 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, KBID, PublishedDate, Approved) by Computer, SourceComputerId, UpdateID
| where UpdateState=~"Needed" and Approved!=false
| project-away UpdateState, Approved, TimeGenerated
| summarize computersCount=dcount(SourceComputerId, 2), displayName=any(Title), publishedDate=min(PublishedDate), ClassificationWeight=max(iff(Classification has "Critical", 4, iff(Classification has "Security", 2, 1))) by id=strcat(UpdateID, "_", KBID), classification=Classification, InformationId=strcat("KB", KBID), InformationUrl=iff(isnotempty(KBID), strcat("https://support.microsoft.com/kb/", KBID), ""), osType=2)
| sort by ClassificationWeight desc, computersCount desc, displayName asc
| extend informationLink=(iff(isnotempty(InformationId) and isnotempty(InformationUrl), toobject(strcat('{ "uri": "', InformationUrl, '", "text": "', InformationId, '", "target": "blank" }')), toobject('')))
| project-away ClassificationWeight, InformationId, InformationUrl

Nästa steg