<?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 Re: Any way to check ESXi root password Changed Date through PowerCLI in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/1853962#M62771</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lucd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As there is a time factor involved as per the log retention period of ESXi &amp;amp; vCenter as&amp;nbsp; you said, I tried for alternate approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have gone through couple of blogs and found below command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below command is working only on ESXi 6.5 and above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Segoe UI',sans-serif; font-size: 10pt;"&gt;&lt;SPAN style="color: black; font-family: 'Segoe UI',sans-serif; font-size: 10pt;"&gt;[root@localhost:~] &lt;/SPAN&gt;myDays=$(cat /etc/shadow | grep root | awk -F ":"'{print $3}')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Segoe UI',sans-serif; font-size: 10pt;"&gt;[root@localhost:~] date -d "1970-01-01 +$(($myDays *24))"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Segoe UI',sans-serif; font-size: 10pt;"&gt;We have more servers running on ESXi 6.0 environment and above command is not working.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Segoe UI',sans-serif; font-size: 10pt;"&gt;Is there any way that we can execute above command through PowerCLI which will work both on ESXi 6.0 &amp;amp; 6.5.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jul 2019 07:50:27 GMT</pubDate>
    <dc:creator>Sivaramsharmar</dc:creator>
    <dc:date>2019-07-30T07:50:27Z</dc:date>
    <item>
      <title>Any way to check ESXi root password Changed Date through PowerCLI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/1853960#M62769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there Any way to check ESXi root password Changed Date through PowerCLI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ESXi version : 6.0&lt;/P&gt;&lt;P&gt;vCenter : 6.0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 03:21:29 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/1853960#M62769</guid>
      <dc:creator>Sivaramsharmar</dc:creator>
      <dc:date>2019-07-30T03:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to check ESXi root password Changed Date through PowerCLI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/1853961#M62770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, the change will create a &lt;A href="https://vdc-download.vmware.com/vmwb-repository/dcr-public/fe08899f-1eec-4d8d-b3bc-a6664c168c2c/7fdf97a1-4c0d-4be0-9d43-2ceebbc174d9/doc/vim.event.UserPasswordChanged.html"&gt;UserPasswordChanged&lt;/A&gt; event.&lt;/P&gt;&lt;P&gt;You can get those events and the date with the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;esxName&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;MyEsx&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Get-VIEvent&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;Start &lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;Get-Date&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)&lt;/SPAN&gt;.AddMinutes&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;-15&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;MaxSamples &lt;SPAN style="color: #000000;"&gt;([&lt;/SPAN&gt;&lt;SPAN style="color: #00008b;"&gt;int&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;]&lt;/SPAN&gt;::MaxValue&lt;SPAN style="color: #000000;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;|&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #00008b;"&gt;where&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;_&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-is&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #00008b;"&gt;VMware.Vim.UserPasswordChanged&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;]&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-and&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;_.UserName&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-eq&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;root&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-and&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;_.Host.Name&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-eq&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;esxName&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;}&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;|&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Select CreatedTime&lt;SPAN style="color: #a9a9a9;"&gt;,&lt;/SPAN&gt; FullFormattedMessage&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can run this against a connection to a vCenter or a connection against an ESXi node.&lt;/P&gt;&lt;P&gt;On an ESXi node events are kept for about 1 hour, on a vCenter events are kept for the valu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 06:55:40 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/1853961#M62770</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2019-07-30T06:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to check ESXi root password Changed Date through PowerCLI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/1853962#M62771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lucd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As there is a time factor involved as per the log retention period of ESXi &amp;amp; vCenter as&amp;nbsp; you said, I tried for alternate approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have gone through couple of blogs and found below command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below command is working only on ESXi 6.5 and above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Segoe UI',sans-serif; font-size: 10pt;"&gt;&lt;SPAN style="color: black; font-family: 'Segoe UI',sans-serif; font-size: 10pt;"&gt;[root@localhost:~] &lt;/SPAN&gt;myDays=$(cat /etc/shadow | grep root | awk -F ":"'{print $3}')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Segoe UI',sans-serif; font-size: 10pt;"&gt;[root@localhost:~] date -d "1970-01-01 +$(($myDays *24))"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Segoe UI',sans-serif; font-size: 10pt;"&gt;We have more servers running on ESXi 6.0 environment and above command is not working.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Segoe UI',sans-serif; font-size: 10pt;"&gt;Is there any way that we can execute above command through PowerCLI which will work both on ESXi 6.0 &amp;amp; 6.5.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 07:50:27 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/1853962#M62771</guid>
      <dc:creator>Sivaramsharmar</dc:creator>
      <dc:date>2019-07-30T07:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to check ESXi root password Changed Date through PowerCLI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/1853963#M62772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following can do this (there seems to be an error in your code).&lt;/P&gt;&lt;P&gt;It assumes that you have the &lt;A href="https://www.powershellgallery.com/packages/Posh-SSH/2.1"&gt;Posh-SSH module&lt;/A&gt; installed (see &lt;A href="http://www.lucd.info/knowledge-base/use-posh-ssh-instead-of-putty/"&gt;Use Posh-SSH instead of PuTTY&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;esxName&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;MyEsx&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;cred&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Get-Credential&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;Message &lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;Credentials for &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;esxName&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;esx&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Get-VMHost&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;Name &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;esxName&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;cmdSub&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #8b0000;"&gt;@'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #8b0000;"&gt;days=$(awk -F":" '$1 == "root" {print $3}' /etc/shadow)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #8b0000;"&gt;seconds_since_epoch=$((days*60*60*24))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #8b0000;"&gt;date --date=@$((seconds_since_epoch))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #8b0000;"&gt;'@&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;session&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;New-SSHSession&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;ComputerName &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;esx.Name&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;Credential &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;cred&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;AcceptKey&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;result&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Invoke-SSHCommand&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;SSHSession &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;session&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;Command &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;cmdSub&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Remove-SSHSession&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;SSHSession &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;session&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;|&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Out-Null&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;result.Output&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 09:13:13 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/1853963#M62772</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2019-07-30T09:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to check ESXi root password Changed Date through PowerCLI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/1853964#M62773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks as if the root password age is returned as Sat Jul 29 00:00:00 UTC 2006 when you still are using the original password defined during the installation of ESXi.&lt;/P&gt;&lt;P&gt;At least that is what I seem to see in ESXi 6.7&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 09:15:36 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/1853964#M62773</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2019-07-30T09:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to check ESXi root password Changed Date through PowerCLI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/2990452#M113461</link>
      <description>&lt;P&gt;While I haven't had prior experience with the posh-ssh module, I find it quite intriguing, and I appreciate you bringing it to my attention.&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.vmware.com/t5/user/viewprofilepage/user-id/256147"&gt;@LucD&lt;/a&gt;&amp;nbsp;, I'm curious about the feasibility of modifying the code snippet below to enable the collection of information for each host within a vCenter. Specifically, I'm interested in querying each host to retrieve details about local users, including password age, complexity settings, and historical data. This capability would be immensely valuable, particularly for those of us who need to navigate security audits such as PCI compliance and similar requirements. Thanks so much for all you do in this portal, truly a value add for the admins.&lt;/P&gt;&lt;P&gt;Additionally it would be a tremendous help to have a one stop shop script to first enable ssh on each host withing a vcenter just before attempting this audit as well.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 19:26:40 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Any-way-to-check-ESXi-root-password-Changed-Date-through/m-p/2990452#M113461</guid>
      <dc:creator>RJ4719</dc:creator>
      <dc:date>2023-10-10T19:26:40Z</dc:date>
    </item>
  </channel>
</rss>

