نماذج الاستعلامات

فيما يلي بعض نماذج الاستعلامات لمساعدتك على البدء في الاستعلام عن تقييم التحديث ومعلومات النشر التي تم جمعها من الأجهزة المدارة. لمزيد من المعلومات حول السجلات التي تم إنشاؤها من عمليات مثل تقييمات التحديث والتثبيتات، راجع نظرة عامة على سجلات الاستعلام.

سرد التحديثات المتوفرة لجميع أجهزتك المجمعة حسب فئة التحديث

يقوم الاستعلام التالي بإرجاع قائمة بالتحديثات المعلقة لجهازك مع الوقت الذي تم فيه إجراء التقييم، ومعرف المورد للتقييم، ونوع نظام التشغيل على الجهاز، وتحديثات نظام التشغيل المتوفرة بناء على تصنيف التحديث.

patchassessmentresources
| where type !has "softwarepatches"
| extend prop = parse_json(properties)
| extend lastTime = properties.lastModifiedDateTime
| extend updateRollupCount = prop.availablePatchCountByClassification.updateRollup, featurePackCount = prop.availablePatchCountByClassification.featurePack, servicePackCount = prop.availablePatchCountByClassification.servicePack, definitionCount = prop.availablePatchCountByClassification.definition, securityCount = prop.availablePatchCountByClassification.security, criticalCount = prop.availablePatchCountByClassification.critical, updatesCount = prop.availablePatchCountByClassification.updates, toolsCount = prop.availablePatchCountByClassification.tools, otherCount = prop.availablePatchCountByClassification.other, OS = prop.osType
| project lastTime, id, OS, updateRollupCount, featurePackCount, servicePackCount, definitionCount, securityCount, criticalCount, updatesCount, toolsCount, otherCount

عدد عمليات تثبيت التحديث

يقوم الاستعلام التالي بإرجاع قائمة بتثبيتات التحديث مع حالتها للأجهزة الخاصة بك من الأيام السبعة الماضية. تتضمن النتائج وقت تشغيل نشر التحديث، ومعرف المورد للتثبيت، وتفاصيل الجهاز، وعدد تحديثات نظام التشغيل المثبتة استنادا إلى حالتها واختيارك.

patchinstallationresources
| where type !has "softwarepatches"
| extend machineName = tostring(split(id, "/", 8)), resourceType = tostring(split(type, "/", 0)), tostring(rgName = split(id, "/", 4))
| extend prop = parse_json(properties)
| extend lTime = todatetime(prop.lastModifiedDateTime), OS = tostring(prop.osType), installedPatchCount = tostring(prop.installedPatchCount), failedPatchCount = tostring(prop.failedPatchCount), pendingPatchCount = tostring(prop.pendingPatchCount), excludedPatchCount = tostring(prop.excludedPatchCount), notSelectedPatchCount = tostring(prop.notSelectedPatchCount)
| where lTime > ago(7d)
| project lTime, RunID=name,machineName, rgName, resourceType, OS, installedPatchCount, failedPatchCount, pendingPatchCount, excludedPatchCount, notSelectedPatchCount

قائمة بتثبيتات تحديث نظام التشغيل Windows Server

يقوم الاستعلام التالي بإرجاع قائمة بتثبيتات التحديث ل Windows Server مع حالتها للأجهزة الخاصة بك من الأيام السبعة الماضية. تتضمن النتائج الوقت الذي تم فيه تشغيل نشر التحديث، ومعرف المورد للتثبيت، وتفاصيل الجهاز، وتفاصيل التوزيع الأخرى ذات الصلة.

patchinstallationresources
| where type has "softwarepatches" and properties !has "version"
| extend machineName = tostring(split(id, "/", 8)), resourceType = tostring(split(type, "/", 0)), tostring(rgName = split(id, "/", 4)), tostring(RunID = split(id, "/", 10))
| extend prop = parse_json(properties)
| extend lTime = todatetime(prop.lastModifiedDateTime), patchName = tostring(prop.patchName), kbId = tostring(prop.kbId), installationState = tostring(prop.installationState), classifications = tostring(prop.classifications)
| where lTime > ago(7d)
| project lTime, RunID, machineName, rgName, resourceType, patchName, kbId, classifications, installationState
| sort by RunID

قائمة بتثبيتات تحديث نظام التشغيل Linux

يقوم الاستعلام التالي بإرجاع قائمة بتثبيتات التحديث لنظام Linux مع حالتها لأجهزتك من الأيام السبعة الماضية. تتضمن النتائج الوقت الذي تم فيه تشغيل نشر التحديث، ومعرف المورد للتثبيت، وتفاصيل الجهاز، وتفاصيل التوزيع الأخرى ذات الصلة.

patchinstallationresources
| where type has "softwarepatches" and properties has "version"
| extend machineName = tostring(split(id, "/", 8)), resourceType = tostring(split(type, "/", 0)), tostring(rgName = split(id, "/", 4)), tostring(RunID = split(id, "/", 10))
| extend prop = parse_json(properties)
| extend lTime = todatetime(prop.lastModifiedDateTime), patchName = tostring(prop.patchName), version = tostring(prop.version), installationState = tostring(prop.installationState), classifications = tostring(prop.classifications)
| where lTime > ago(7d)
| project lTime, RunID, machineName, rgName, resourceType, patchName, version, classifications, installationState
| sort by RunID

قائمة سجل تشغيل الصيانة على مستوى الجهاز الظاهري

يقوم الاستعلام التالي بإرجاع قائمة بجميع سجلات تشغيل الصيانة لجهاز ظاهري

maintenanceresources 
| where ['id'] contains "/subscriptions/<subscription-id>/resourcegroups/<resource-group>/providers/microsoft.compute/virtualmachines/<vm-name>" //VM Id here
| where ['type'] == "microsoft.maintenance/applyupdates" 
| where properties.maintenanceScope == "InGuestPatch"

الخطوات التالية