Güncelleştirme Yönetimi günlüklerini sorgulama

Güncelleştirme Yönetimi dağıtımı sırasında sağlanan ayrıntılara ek olarak Log Analytics çalışma alanınızda depolanan günlüklerde arama yapabilirsiniz. Otomasyon hesabınızdan günlükleri aramak için Güncelleştirme yönetimi'ni seçin ve dağıtımınızla ilişkili Log Analytics çalışma alanını açın.

Ayrıca günlük sorgularını özelleştirebilir veya farklı istemcilerden kullanabilirsiniz. Log Analytics arama API'si belgelerine bakın.

Sorgu güncelleştirme kayıtları

Güncelleştirme Yönetimi, Windows ve Linux VM'lerinin kayıtlarını ve günlük arama sonuçlarında görünen veri türlerini toplar. Aşağıdaki bölümlerde bu kayıtlar açıklanmaktadır.

Sorgu Güncelleştirme kaydı

Bir makine için kullanılabilir güncelleştirmeleri ve yükleme durumlarını temsil eden türüne Update sahip bir kayıt oluşturulur. Bu kayıtlar aşağıdaki tabloda yer alan özelliklere sahiptir:

Özellik Tanım
TenantId Kuruluşunuzun Microsoft Entra Id örneğini temsil eden benzersiz tanımlayıcı.
SourceSystem Kaydın kaynak sistemi. Bu durumda değer OperationsManager olur.
TimeGenerated Kayıt oluşturma tarihi ve saati.
SourceComputerId Kaynak bilgisayarı temsil eden benzersiz tanımlayıcı.
Başlık Güncelleştirmenin başlığı.
Sınıflandırma Onay sınıflandırması. Değer Güncelleştirmeler.
PublishedDate (UTC) Güncelleştirmenin Windows Update'ten indirilmeye ve yüklenmeye hazır olduğu tarih.
Bilgisayar Raporlama makinesinin tam etki alanı adı.
UpdateState Güncelleştirmenin geçerli durumu.
Ürün Güncelleştirmenin geçerli olduğu ürünler.
OSType İşletim sistemi türü. Değerler Windows veya Linux'tır.
Productversion Güncelleştirmenin sürümü.
Ürün Kemeri Geçerli makine mimarisi
CVENumbers Yaygın Güvenlik Açıkları ve Açığa Çıkarma sayısı
BulletinUrl Bülten URL'si
Bülten Kimliği Bülten kimliği numarası.
PackageRepository Paketin depo bilgileri.
PackageSeverity Güncelleştirmenin önem derecesi.
OSName İşletim sistemi türü. Değerler Windows veya Linux'tır.
OSVersion İşletim sisteminin sürümü.
OSFullName İşletim sisteminin adı.
SubscriptionId Azure aboneliğinin benzersiz tanımlayıcısı.
ResourceGroup Kaynağın ait olduğu kaynak grubunun adı.
ResourceProvider Kaynak sağlayıcısı.
Kaynak Kaynağın adı.
ResourceId Kayıtla ilişkili kaynağın benzersiz tanımlayıcısı.
ResourceType Kaynağın türü.
ComputerEnvironment Ortam. Olası değerler Azure veya Azure dışı değerlerdir.
VMUUID Sanal makine için benzersiz tanımlayıcı.
MG Yönetim grubu veya Log Analytics çalışma alanı için benzersiz tanımlayıcı.
ManagementGroupName Operations Manager yönetim grubunun veya Log Analytics çalışma alanının adı.
MSRCSeverity Güvenlik açığı için önem derecesi. Değerler şunlardır:
Kritik
Önemli
Orta
Düşük
KBID Windows güncelleştirmesi için bilgi bankası makale kimliği.
UpdateID Yazılım güncelleştirmesinin benzersiz tanımlayıcısı.
RevisionNumber Bir güncelleştirmenin belirli bir düzeltmesinin düzeltme numarası.
İsteğe bağlı Kayıt isteğe bağlıysa True veya aksi halde False.
RebootBehavior Bir güncelleştirmeyi yükledikten/kaldırdıktan sonra yeniden başlatma davranışı.
MSRCBulletinID Güvenlik bülteni kimlik numarası.
Onaylandı Kayıt onaylanırsa True veya aksi halde False.
ApprovalSource Yalnızca Windows işletim sistemi için geçerlidir. Kayıt için onay kaynağı. Değer Microsoft Update'tir.
InstallTimePredictionSeconds
InstallTimeDeviationRangeSeconds
InstallTimeAvailable
Tür Kayıt türü. Değer Update'tir.

Sorgu Güncelleştirme Dağıtım Durumu kaydı

Makineye göre zamanlanmış bir dağıtımın UpdateRunProgress güncelleştirme dağıtım durumunu sağlayan türde bir kayıt oluşturulur. Bu kayıtlar aşağıdaki tabloda yer alan özelliklere sahiptir:

Özellik Tanım
TenantId Kuruluşunuzun Microsoft Entra Id örneğini temsil eden benzersiz tanımlayıcı.
SourceSystem Kayıt için kaynak sistem. Bu durumda değer OperationsManager olur.
TimeGenerated Kayıt oluşturma tarihi ve saati.
MG Yönetim grubu veya Log Analytics çalışma alanı için benzersiz tanımlayıcı.
ManagementGroupName Operations Manager yönetim grubunun veya Log Analytics çalışma alanının adı.
SourceComputerId Kaynak bilgisayarı temsil eden benzersiz tanımlayıcı.
KBID Windows güncelleştirmesi için bilgi bankası makale kimliği.
UpdateId Yazılım güncelleştirmesinin benzersiz tanımlayıcısı.
SucceededOnRetry Güncelleştirme yürütmesinin ilk denemede başarısız olup olmadığını ve geçerli işlemin yeniden deneme girişimi olduğunu gösteren değer.
ErrorResult Bir güncelleştirme yüklenemezse Windows Update hata kodu oluşturulur.
UpdateRunName Güncelleştirme zamanlamasının adı.
InstallationStatus İstemci bilgisayarda bir güncelleştirmenin olası yükleme durumları,
NotStarted - iş henüz tetiklenmedi.
Failed - iş başlatıldı ancak bir özel durumla başarısız oldu.
InProgress - devam eden iş.
MaintenanceWindowExceeded - yürütme kaldıysa ancak bakım penceresi aralığına ulaşıldıysa.
Succeeded - iş başarılı oldu.
Install Failed - güncelleştirme başarıyla yüklenemedi.
NotIncluded - ilgili güncelleştirmenin sınıflandırması, müşterinin giriş sınıflandırma listesindeki girdileriyle eşleşmiyor.
Excluded - kullanıcı dışlananlar listesine bir KBID girer. Düzeltme eki uygulama sırasında, dışlanan listedeki KBID sistem tarafından algılanan güncelleştirme KB kimliğiyle eşleşiyorsa, dışlanmış olarak işaretlenir.
Bilgisayar Raporlama makinesinin tam etki alanı adı.
Başlık Güncelleştirmenin başlığı.
Ürün Güncelleştirmenin geçerli olduğu ürünler.
OSType İşletim sistemi türü. Değerler Windows veya Linux'tır.
StartTime (UTC) Güncelleştirmenin yüklenmek üzere zamanlandığı zaman. Bu özellik şu anda kullanılmıyor. Bkz. TimeGenerated.
EndTime (UTC) Eşitleme işleminin sona ertiği saat. Bu özellik şu anda kullanılmıyor. Bkz. TimeGenerated.
CorrelationId Güncelleştirme için runbook işinin benzersiz tanımlayıcısı çalıştırılır.
SubscriptionId Azure aboneliğinin benzersiz tanımlayıcısı.
ResourceGroup Kaynağın ait olduğu kaynak grubunun adı.
ResourceProvider Kaynak sağlayıcısı.
Kaynak Kaynağın adı.
ResourceId Kayıtla ilişkili kaynağın benzersiz tanımlayıcısı.
ResourceType Kaynak türü.
ComputerEnvironment Ortam. Değerler Azure veya Azure dışı değerlerdir.
VMUUID Sanal makine için benzersiz tanımlayıcı.
Tür Güncelleştirmenin türü. Bu durumda değer UpdateRunProgress olur.
_ResourceId Kayıtla ilişkili kaynağın benzersiz tanımlayıcısı.

Sorgu Güncelleştirme Özeti kaydı

Makineye göre güncelleştirme özeti sağlayan türüne UpdateSummary sahip bir kayıt oluşturulur. Bu kayıtlar aşağıdaki tabloda yer alan özelliklere sahiptir:

Özellik Tanım
TenantId Kuruluşunuzun Microsoft Entra Id örneğini temsil eden benzersiz tanımlayıcı.
SourceSystem Kayıt için kaynak sistem. Bu durumda değer OpsManager olur.
TimeGenerated Kayıt oluşturma tarihi ve saati.
MG Yönetim grubu veya Log Analytics çalışma alanı için benzersiz tanımlayıcı.
ManagementGroupName Operations Manager yönetim grubunun veya Log Analytics çalışma alanının adı.
SourceComputerId Sanal makine için benzersiz tanımlayıcı.
LastUpdateApplied (UTC)
OldestMissingSecurityUpdateInDays Yüklenmemiş geçerli olarak algılanan en eski güncelleştirmenin toplam gün sayısı.
OldestMissingSecurityUpdateBucket En eski eksik güvenlik demetinin tanımlayıcısı. Değerler şunlardır:
Değer 30 günden kısaysa en son
30 gün önce
60 gün önce
90 gün önce
120 gün önce
150 gün önce
180 gün önce
Değer 180 günden büyükse daha eski.
WindowsUpdateSetting Windows Update aracısının durumu. Olası değerler şunlardır:
Scheduled installation
Notify before installation
Error returned from unhealthy WUA agent
WindowsUpdateAgentVersion Windows Update aracısının sürümü.
WSUSServer Sorun gidermeye yardımcı olmak için Windows Update aracısının bir sorunu varsa hatalar.
Bilgisayar Raporlama makinesinin tam etki alanı adı.
OsVersion İşletim sisteminin sürümü.
NETRuntimeVersion Windows bilgisayarda yüklü .NET Framework sürümü.
CriticalUpdatesMissing Eksik geçerli kritik güncelleştirmelerin sayısı.
SecurityUpdatesMissing Geçerli olan eksik güvenlik güncelleştirmelerinin sayısı.
OtherUpdatesMissing Algılanan güncelleştirmelerin sayısı eksik.
TotalUpdatesMissing Geçerli olan eksik güncelleştirmelerin toplam sayısı.
RestartPending Yeniden başlatma bekliyorsa True veya aksi halde False.
SubscriptionId Azure aboneliğinin benzersiz tanımlayıcısı.
ResourceGroup Kaynağı içeren kaynak grubunun adı.
ResourceProvider Kaynak sağlayıcısı.
Kaynak Kaydın kaynağının adı.
ResourceId Kayıtla ilişkili kaynağın benzersiz tanımlayıcısı.
ResourceType Kaynak türü.
ComputerEnvironment Ortam. Değerler Azure veya Azure dışı değerlerdir.
VMUUID Sanal makine için benzersiz tanımlayıcı.
Tür Kayıt türü. Bu durumda değer UpdateSummary olur.
_ResourceId Kayıtla ilişkili kaynağın benzersiz tanımlayıcısı.

Örnek sorgular

Aşağıdaki bölümlerde, Güncelleştirme Yönetimi için toplanan güncelleştirme kayıtları için örnek günlük sorguları sağlanır.

Güncelleştirme Yönetimi için Azure dışı makinelerin etkinleştirildiğini onaylayın

Doğrudan bağlı makinelerin Azure İzleyici günlükleriyle iletişim kurduğunu onaylamak için aşağıdaki günlük aramalarından birini çalıştırın.

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

Bir Windows bilgisayarında, Azure İzleyici günlükleriyle aracı bağlantısını doğrulamak için aşağıdaki bilgileri gözden geçirebilirsiniz:

  1. Denetim Masası'da Microsoft Monitoring Agent'ı açın. Azure Log Analytics sekmesinde aracı şu iletiyi görüntüler: Microsoft Monitoring Agent, Log Analytics'e başarıyla bağlandı.

  2. Windows Olay Günlüğü'nü açın. Uygulama ve Hizmet Günlükleri\Operations Manager'a gidin ve kaynak Hizmet Bağlan or'dan Olay Kimliği 3000 ve Olay Kimliği 5002'yi arayın. Bu olaylar, bilgisayarın Log Analytics çalışma alanına kaydolduğunu ve yapılandırmayı aldığını gösterir.

Aracı Azure İzleyici günlükleriyle iletişim kuramıyorsa ve aracı bir güvenlik duvarı veya ara sunucu üzerinden İnternet ile iletişim kuracak şekilde yapılandırılmışsa, güvenlik duvarının veya ara sunucunun düzgün yapılandırıldığını onaylayın. Güvenlik duvarının veya ara sunucunun düzgün yapılandırıldığını doğrulamayı öğrenmek için bkz . Windows aracısı için ağ yapılandırması veya Linux aracısı için ağ yapılandırması.

Dekont

Linux sistemleriniz bir ara sunucu veya Log Analytics Ağ Geçidi ile iletişim kuracak şekilde yapılandırılmışsa ve Güncelleştirme Yönetimi'ni etkinleştiriyorsanız, aşağıdaki komutları kullanarak omiuser grubuna dosya üzerinde okuma izni vermek için izinleri güncelleştirin proxy.conf :

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

Yeni eklenen Linux aracıları, değerlendirme yapıldıktan sonra Güncelleştirildi durumunu gösterir. Bu işlem 6 saat kadar sürebilir.

Bir Operations Manager yönetim grubunun Azure İzleyici günlükleriyle iletişim kurduğunu onaylamak için bkz . Azure İzleyici günlükleriyle Operations Manager tümleştirmesini doğrulama.

Tek Azure VM Değerlendirme sorguları (Windows)

VMUUID değerini sorguladığınız sanal makinenin VM GUID'siyle değiştirin. Azure İzleyici günlüklerinde aşağıdaki sorguyu çalıştırarak kullanılması gereken VMUUID'yi bulabilirsiniz: Update | where Computer == "<machine name>" | summarize by Computer, VMUUID

Eksik güncelleştirme özeti

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

Eksik güncelleştirmeler listesi

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

Tek Azure VM değerlendirme sorguları (Linux)

Bazı Linux dağıtımları için Azure Resource Manager'dan gelen VMUUID değeriyle ve Azure İzleyici günlüklerinde depolananlarla bir son durum uyumsuzluğu vardır. Aşağıdaki sorgu, her iki bitişte de eşleşmeyi denetler. Sonuçları düzgün döndürmek için VMUUID değerlerini GUID'nin büyük endian ve küçük endian biçimiyle değiştirin. Azure İzleyici günlüklerinde aşağıdaki sorguyu çalıştırarak kullanılması gereken VMUUID'yi bulabilirsiniz: Update | where Computer == "<machine name>" | summarize by Computer, VMUUID

Eksik güncelleştirme özeti

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

Eksik güncelleştirmeler listesi

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

Çoklu VM değerlendirme sorguları

Bilgisayarlar özeti

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

Eksik güncelleştirme özeti

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

Bilgisayarlar listesi

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

Eksik güncelleştirmeler listesi

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

Sonraki adımlar