Update Management-naplók lekérdezése

Az Update Management üzembe helyezése során megadott adatokon kívül a Log Analytics-munkaterületen tárolt naplókban is kereshet. Az Automation-fiók naplóinak kereséséhez válassza a Frissítéskezelés lehetőséget, és nyissa meg az üzembe helyezéshez társított Log Analytics-munkaterületet.

Testre is szabhatja a napló lekérdezéseit, vagy használhatja őket különböző ügyfelekről. Lásd a Log Analytics keresési API dokumentációját.

Lekérdezésfrissítési rekordok

Az Update Management összegyűjti a Windows- és Linux rendszerű virtuális gépek rekordjait, valamint a naplókeresési eredményekben megjelenő adattípusokat. A következő szakaszok ezeket a rekordokat ismertetik.

Lekérdezésfrissítési rekord

Létrejön egy Update olyan típusú rekord, amely az elérhető frissítéseket és a gépek telepítési állapotát jelöli. Ezek a rekordok az alábbi táblázatban található tulajdonságokat tartalmaznak:

Property Leírás
TenantId A szervezet Microsoft Entra-azonosítójának példányát jelképező egyedi azonosító.
SourceSystem A rekord forrásrendszere. Az érték OperationsManager.
TimeGenerated A rekordlétrehozás dátuma és időpontja.
SourceComputerId A forrásszámítógépet jelképező egyedi azonosító.
Cím A frissítés címe.
Classification Jóváhagyási besorolás. Az érték Frissítések.
PublishedDate (UTC) Az a dátum, amikor a frissítés készen áll a Windows Update-ből való letöltésre és telepítésre.
Számítógép A jelentéskészítő gép teljes tartományneve.
UpdateState A frissítés aktuális állapota.
Termék Azok a termékek, amelyekre a frissítés vonatkozik.
OSType Az operációs rendszer típusa. Az értékek Windows vagy Linux rendszerűek.
ProductVersion A frissítés verziója.
Termékív Alkalmazható géparchitektúra
CVENumbers Gyakori biztonsági rések és kitettségek száma
BulletinUrl A közlemény URL-címe
BulletinID A közlemény azonosítója.
PackageRepository A csomag adattárának adatai.
PackageSeverity A frissítés súlyossága.
OSName Az operációs rendszer típusa. Az értékek Windows vagy Linux rendszerűek.
OSVersion Az operációs rendszer verziója.
OSFullName Az operációs rendszer neve.
SubscriptionId Az Azure-előfizetés egyedi azonosítója.
ResourceGroup Annak az erőforráscsoportnak a neve, amelyhez az erőforrás tartozik.
ResourceProvider Az erőforrás-szolgáltató.
Resource Az erőforrás neve.
ResourceId A rekordhoz társított erőforrás egyedi azonosítója.
ResourceType Az erőforrás típusa.
ComputerEnvironment Környezet. Lehetséges értékek: Azure vagy Nem Azure.
VMUUID A virtuális gép egyedi azonosítója.
MG A felügyeleti csoport vagy a Log Analytics-munkaterület egyedi azonosítója.
ManagementGroupName Az Operations Manager felügyeleti csoport vagy a Log Analytics-munkaterület neve.
MSRCSeverity A biztonsági rés súlyossági besorolása. Az értékek a következők:
Critical
Fontos
Mérsékelt
Alacsony
KBID A Windows-frissítés tudásbáziscikk-azonosítója.
UpdateID A szoftverfrissítés egyedi azonosítója.
RevisionNumber A frissítés adott változatának változatszáma.
Lehetséges Igaz, ha a rekord nem kötelező, vagy hamis.
RebootBehavior A frissítés telepítése/eltávolítása utáni újraindítási viselkedés.
MSRCBulletinID Biztonsági közlemény azonosítószáma.
Jóváhagyva Igaz, ha a rekord jóvá van hagyva, vagy hamis.
Jóváhagyási forrás Csak Windows operációs rendszerre vonatkozik. A rekord jóváhagyásának forrása. Az érték a Microsoft Update.
InstallTimePredictionSeconds
InstallTimeDeviationRangeSeconds
InstallTimeAvailable
Type Rekord típusa. Az érték a Frissítés.

Lekérdezésfrissítés üzembehelyezési állapotrekordja

Létrejön egy UpdateRunProgress olyan típusú rekord, amely egy ütemezett üzembe helyezés frissítési állapotát biztosítja gép szerint. Ezek a rekordok az alábbi táblázatban található tulajdonságokat tartalmaznak:

Property Leírás
TenantId A szervezet Microsoft Entra-azonosítójának példányát jelképező egyedi azonosító.
SourceSystem A rekord forrásrendszere. Az érték OperationsManager.
TimeGenerated A rekordlétrehozás dátuma és időpontja.
MG A felügyeleti csoport vagy a Log Analytics-munkaterület egyedi azonosítója.
ManagementGroupName Az Operations Manager felügyeleti csoport vagy a Log Analytics-munkaterület neve.
SourceComputerId A forrásszámítógépet jelképező egyedi azonosító.
KBID A Windows-frissítés tudásbáziscikk-azonosítója.
UpdateId A szoftverfrissítés egyedi azonosítója.
SucceededOnRetry Az az érték, amely azt jelzi, hogy a frissítés végrehajtása sikertelen volt-e az első kísérlet során, és az aktuális művelet újrapróbálkozási kísérlet.
ErrorResult A Windows Update hibakódja akkor jön létre, ha egy frissítés telepítése sikertelen.
UpdateRunName A frissítési ütemezés neve.
InstallationStatus A frissítés lehetséges telepítési állapota az ügyfélszámítógépen,
NotStarted - a feladat még nem aktiválódott.
Failed - a feladat elindult, de kivétellel meghiúsult.
InProgress - folyamatban lévő feladat.
MaintenanceWindowExceeded - ha a végrehajtás még hátra volt, de a karbantartási időszak elérte az időtartamot.
Succeeded - a feladat sikeres volt.
Install Failed - a frissítés telepítése sikertelen volt.
NotIncluded - a megfelelő frissítés besorolása nem egyezik a bemeneti besorolási listában szereplő ügyfél bejegyzéseivel.
Excluded - a felhasználó a kizárt listában egy KBID azonosítót ad meg. A javítás során, ha a kizárt listában szereplő KBID megegyezik a rendszer által észlelt frissítési TUDÁSBÁZIS-azonosítóval, akkor a rendszer kizártként jelöli meg.
Számítógép A jelentéskészítő gép teljes tartományneve.
Cím A frissítés címe.
Termék Azok a termékek, amelyekre a frissítés vonatkozik.
OSType Az operációs rendszer típusa. Az értékek Windows vagy Linux rendszerűek.
StartTime (UTC) A frissítés telepítésének időpontja. Ez a tulajdonság jelenleg nincs használatban. Lásd: TimeGenerated.
EndTime (UTC) A szinkronizálási folyamat befejezésének időpontja. Ez a tulajdonság jelenleg nincs használatban. Lásd: TimeGenerated.
CorrelationId A frissítéshez futtatott runbook-feladat egyedi azonosítója.
SubscriptionId Az Azure-előfizetés egyedi azonosítója.
ResourceGroup Annak az erőforráscsoportnak a neve, amelyhez az erőforrás tartozik.
ResourceProvider Az erőforrás-szolgáltató.
Resource Az erőforrás neve.
ResourceId A rekordhoz társított erőforrás egyedi azonosítója.
ResourceType Erőforrástípus.
ComputerEnvironment Környezet. Az értékek azure-beliek vagy nem Azure-beliek.
VMUUID A virtuális gép egyedi azonosítója.
Type A frissítés típusa. Az érték UpdateRunProgress.
_ResourceId A rekordhoz társított erőforrás egyedi azonosítója.

Lekérdezésfrissítés összesítő rekordja

Létrejön egy UpdateSummary olyan típusú rekord, amely gépi frissítési összegzést biztosít. Ezek a rekordok az alábbi táblázatban található tulajdonságokat tartalmaznak:

Property Leírás
TenantId A szervezet Microsoft Entra-azonosítójának példányát jelképező egyedi azonosító.
SourceSystem A rekord forrásrendszere. Az érték OpsManager.
TimeGenerated A rekordlétrehozás dátuma és időpontja.
MG A felügyeleti csoport vagy a Log Analytics-munkaterület egyedi azonosítója.
ManagementGroupName Az Operations Manager felügyeleti csoport vagy a Log Analytics-munkaterület neve.
SourceComputerId A virtuális gép egyedi azonosítója.
LastUpdateApplied (UTC)
OldestMissingSecurityUpdateInDays A nem telepített legrégebbi frissítéshez észlelt napok teljes száma.
OldestMissingSecurityUpdateBucket A legrégebbi hiányzó biztonsági gyűjtő megadása. Az értékek a következők:
Legutóbbi, ha az érték 30 napnál rövidebb
30 nappal ezelőtt
60 nappal ezelőtt
90 nappal ezelőtt
120 nappal ezelőtt
150 nappal ezelőtt
180 nappal ezelőtt
Régebbi, ha az érték nagyobb, mint 180 nap.
WindowsUpdateSetting A Windows Update-ügynök állapota. A lehetséges értékek a következők:
Scheduled installation
Notify before installation
Error returned from unhealthy WUA agent
WindowsUpdateAgentVersion A Windows Update-ügynök verziója.
WSUSServer Hibák, ha a Windows Update-ügynöknek problémája van, hogy segítsen a hibaelhárításban.
Számítógép A jelentéskészítő gép teljes tartományneve.
OsVersion Az operációs rendszer verziója.
NETRuntimeVersion A windowsos számítógépre telepített .NET-keretrendszer verziója.
CriticalUpdatesMissing Hiányzó releváns kritikus frissítések száma.
SecurityUpdatesMissing A hiányzó biztonsági frissítések száma, amelyek alkalmazhatók.
OtherUpdatesMissing Hiányzó észlelt frissítések száma.
TotalUpdatesMissing A hiányzó frissítések teljes száma, amelyek alkalmazhatók.
RestartPending Igaz, ha az újraindítás függőben van, vagy hamis.
SubscriptionId Az Azure-előfizetés egyedi azonosítója.
ResourceGroup Az erőforrást tartalmazó erőforráscsoport neve.
ResourceProvider Az erőforrás-szolgáltató.
Resource A rekord erőforrásának neve.
ResourceId A rekordhoz társított erőforrás egyedi azonosítója.
ResourceType Erőforrástípus.
ComputerEnvironment Környezet. Az értékek azure-beliek vagy nem Azure-beliek.
VMUUID A virtuális gép egyedi azonosítója.
Type Rekord típusa. Az érték UpdateSummary.
_ResourceId A rekordhoz társított erőforrás egyedi azonosítója.

Sample queries

A következő szakaszok mintanapló-lekérdezéseket nyújtanak az Update Managementhez gyűjtött frissítési rekordokhoz.

Győződjön meg arról, hogy a nem Azure-beli gépek engedélyezve vannak az Update Managementhez

Annak ellenőrzéséhez, hogy a közvetlenül csatlakoztatott gépek kommunikálnak-e az Azure Monitor-naplókkal, futtassa az alábbi naplókeresések egyikét.

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

Windows rendszerű számítógépeken a következő információkat tekintheti át az ügynökök Azure Monitor-naplókkal való kapcsolatának ellenőrzéséhez:

  1. A Vezérlőpult nyissa meg a Microsoft Monitoring Agentet. Az Azure Log Analytics lapon az ügynök a következő üzenetet jeleníti meg: A Microsoft Monitoring Agent sikeresen csatlakozott a Log Analyticshez.

  2. Nyissa meg a Windows eseménynaplóját. Nyissa meg az Application and Services Logs\Operations Manager alkalmazást, és keresse meg a 3000-et és az 5002-s eseményazonosítót a forrásszolgáltatás Csatlakozás orból. Ezek az események jelzik, hogy a számítógép regisztrálva van a Log Analytics-munkaterületen, és konfigurációt kap.

Ha az ügynök nem tud kommunikálni az Azure Monitor-naplókkal, és az ügynök úgy van konfigurálva, hogy tűzfalon vagy proxykiszolgálón keresztül kommunikáljon az internettel, ellenőrizze, hogy a tűzfal vagy a proxykiszolgáló megfelelően van-e konfigurálva. A tűzfal vagy proxykiszolgáló megfelelő konfigurálásának ellenőrzéséhez tekintse meg a Windows-ügynök hálózati konfigurációját vagy a Linux-ügynök hálózati konfigurációját.

Megjegyzés:

Ha a Linux-rendszerek proxyval vagy Log Analytics-átjáróval való kommunikációra vannak konfigurálva, és ön engedélyezi az Update Management szolgáltatást, frissítse az proxy.conf engedélyeket, hogy olvasási engedélyt adjon az omiuser csoportnak a fájlon az alábbi parancsokkal:

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

Az újonnan hozzáadott Linux-ügynökök frissítési állapotot mutatnak az értékelés elvégzése után. A folyamat akár hat órát is igénybe vehet.

Annak ellenőrzéséhez, hogy egy Operations Manager felügyeleti csoport kommunikál-e az Azure Monitor-naplókkal, tekintse meg az Operations Manager és az Azure Monitor-naplók integrációjának ellenőrzése című témakört.

Önálló Azure-beli virtuálisgép-értékelési lekérdezések (Windows)

Cserélje le a VMUUID értéket a lekérdezett virtuális gép virtuálisgép-GUID azonosítójára. A következő lekérdezés Azure Monitor-naplókban való futtatásával megtalálhatja a használni kívánt VMUUID azonosítót: Update | where Computer == "<machine name>" | summarize by Computer, VMUUID

Hiányzó frissítések összefoglalása

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")

Hiányzó frissítések listája

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

Önálló Azure-beli virtuálisgép-értékelési lekérdezések (Linux)

Egyes Linux-disztribúciók esetében az endianness eltérés van az Azure Resource Managerből származó VMUUID-értékkel és az Azure Monitor-naplókban tárolt értékkel. Az alábbi lekérdezés mindkét endianness esetében egyezést keres. Cserélje le a VMUUID-értékeket a GUID big-endian és little-endian formátumára az eredmények megfelelő visszaadásához. A következő lekérdezés Azure Monitor-naplókban való futtatásával megtalálhatja a használni kívánt VMUUID azonosítót: Update | where Computer == "<machine name>" | summarize by Computer, VMUUID

Hiányzó frissítések összefoglalása

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")

Hiányzó frissítések listája

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

Több virtuális gépre kiterjedő értékelési lekérdezések

Számítógépek összegzése

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

Hiányzó frissítések összefoglalása

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")

Számítógépek listája

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

Hiányzó frissítések listája

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

Következő lépések