<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[System.Update.LastInstallTime на Windows Server 2016 (Решение)]]></title><description><![CDATA[<p dir="auto">System.Update.LastInstallTime берет информацию из реестра<br />
ветка HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install<br />
параметр LastSuccessTime</p>
<p dir="auto">В 2016 этот ключ отсутствует.<br />
Решено ежедневным запуском на серверах следующего PowerShell скрипта</p>
<pre><code>$Session = New-Object -ComObject "Microsoft.Update.Session"
$Searcher = $Session.CreateUpdateSearcher()

$historyCount = $Searcher.GetTotalHistoryCount()

$a=$Searcher.QueryHistory(0, $historyCount) | Select-Object Title, Description, Date,

    @{name="Operation"; expression={switch($_.operation){

        1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"}

}}} | where {$_.operation -eq "Installation"} | Select-Object -First 1

$datetimestring = Get-Date $a.Date -Format "yyyy-MM-dd hh:mm:ss"

New-Item 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update' -Name Results
New-Item 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results' -Name Install

Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install' -Name LastSuccessTime -Value $datetimestring
</code></pre>
<p dir="auto">Он возможно избыточен, но работает.</p>
]]></description><link>https://forum.netxms.org/topic/5319/system.update.lastinstalltime-на-windows-server-2016-решение</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 22:46:00 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/5319.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Nov 2017 09:48:40 GMT</pubDate><ttl>60</ttl></channel></rss>