<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to get Windows last update with PowerCLI for Servers from a VCenter? in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990717#M113470</link>
    <description>&lt;P&gt;I want to use powerCLI to check the last update date of Windows Update for servers in VCenter. Im rlly stucked and dont know how to do it. can someone help me?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2023 07:32:17 GMT</pubDate>
    <dc:creator>Kaicy0443</dc:creator>
    <dc:date>2023-10-12T07:32:17Z</dc:date>
    <item>
      <title>How to get Windows last update with PowerCLI for Servers from a VCenter?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990717#M113470</link>
      <description>&lt;P&gt;I want to use powerCLI to check the last update date of Windows Update for servers in VCenter. Im rlly stucked and dont know how to do it. can someone help me?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 07:32:17 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990717#M113470</guid>
      <dc:creator>Kaicy0443</dc:creator>
      <dc:date>2023-10-12T07:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Windows last update with PowerCLI for Servers from a VCenter?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990726#M113471</link>
      <description>&lt;P&gt;You will have to use a command in the Guest OS for that.&lt;BR /&gt;Something like for example&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Get-WmiObject win32_quickfixengineering |
Sort-Object -Property installedon -Descending |
Select-Object -First 1 -Property installedon&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;You can use the &lt;A href="https://developer.vmware.com/docs/powercli/latest/vmware.vimautomation.core/commands/invoke-vmscript/" target="_blank" rel="noopener"&gt;Invoke-VMScript&lt;/A&gt; cmdlet to run such a Guest OS command, provided all the prerequisites are fulfilled.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 07:58:28 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990726#M113471</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-10-12T07:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Windows last update with PowerCLI for Servers from a VCenter?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990730#M113472</link>
      <description>&lt;P&gt;hi LucD,&amp;nbsp;how does it work with invoke-vmscript? All servers of the vcenter have the VMware tools installed. I just want to compare a script with that it creates a list in case the windows update date is older than 90 days&lt;BR /&gt;thank you very much!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 08:03:26 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990730#M113472</guid>
      <dc:creator>Kaicy0443</dc:creator>
      <dc:date>2023-10-12T08:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Windows last update with PowerCLI for Servers from a VCenter?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990734#M113473</link>
      <description>&lt;P&gt;Have a look at the examples on the Invoke-VMScript help page.&lt;BR /&gt;Also, search in this community on Invoke-VMScript, there are ample snippets available.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 08:08:28 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990734#M113473</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-10-12T08:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Windows last update with PowerCLI for Servers from a VCenter?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990752#M113474</link>
      <description>&lt;P&gt;can it be that if I use invoke-vmscript, but the result of it is not the same as I insert the commands on server itself?&lt;BR /&gt;&lt;BR /&gt;fe:&lt;BR /&gt;i used this script for my server file11:&lt;/P&gt;&lt;P&gt;# Get the latest Quick Fix data&lt;BR /&gt;$LatestQuickFix = Get-WmiObject win32_quickfixengineering |&lt;BR /&gt;Sort-Object -Property installedon -Descending |&lt;BR /&gt;Select-Object -First 1&lt;/P&gt;&lt;P&gt;$InstallDate = $LatestQuickFix.installedon.ToString("MM/dd/yyyy")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$Script = "Write-Host 'Latest Quick Fix Installed On: $InstallDate'"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$VMName = "file11"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$result = Invoke-VMScript -VM $VMName -ScriptText $Script -GuestUser $vCenterUser -GuestPassword $vCenterPass&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the $result showed me:&lt;BR /&gt;Latest Quick Fix Installed On: 09.26.2023&lt;BR /&gt;&lt;BR /&gt;but if i do this on my server,&amp;nbsp;&lt;/P&gt;&lt;P&gt;the result:&lt;BR /&gt;InstalledOn&lt;/P&gt;&lt;P&gt;--------------&lt;/P&gt;&lt;P&gt;05.10.2023 00:00:00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im new in powerCLI, can u help me a bit?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 09:36:38 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990752#M113474</guid>
      <dc:creator>Kaicy0443</dc:creator>
      <dc:date>2023-10-12T09:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Windows last update with PowerCLI for Servers from a VCenter?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990762#M113475</link>
      <description>&lt;P&gt;Perhaps try like this.&lt;BR /&gt;&lt;BR /&gt;To make sure, the $vCenterUser and $vCenterPass variables contain the credentials for the Guest OS on the VM named 'file11'?&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;# Get the latest Quick Fix data
$script = @'
$LatestQuickFix = Get-WmiObject win32_quickfixengineering |
   Sort-Object -Property installedon -Descending |
   Select-Object -First 1

$LatestQuickFix.installedon.ToString("MM/dd/yyyy")
'@

$VMName = "file11"
$result = Invoke-VMScript -VM $VMName -ScriptText $Script -GuestUser $vCenterUser -GuestPassword $vCenterPass

$result.ScriptOutput
 &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 10:32:35 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-get-Windows-last-update-with-PowerCLI-for-Servers-from-a/m-p/2990762#M113475</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-10-12T10:32:35Z</dc:date>
    </item>
  </channel>
</rss>

