proxb / PoshPAIG

PowerShell UI used for auditing and installing updates from WSUS to local and remote systems
MIT License
207 stars 61 forks source link

'Update were installed' doesn't get the new date #6

Open micelshima opened 7 years ago

micelshima commented 7 years ago

I have noticed that when updating with PoshPAIG the 'Updates were installed' that you can see in "wuapp" in remote servers doesn't update. this date is stored in LastSuccessTime under the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install May I suggest you to add these three lines in installPatches function?

$updateregistry='reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install" /t REG_SZ /v LastSuccessTime /d "{0:yyyy-MM-dd HH:mm:ss}" /f' -f (get-date) out-file ".\registrywindowsupdate.bat" -input $updateregistry -enc ascii .\psexec.exe -accepteula -s -i \$Computername -c "$pwd\registrywindowsupdate.bat"