Automation

 View Only
  • 1.  Script to fetch details

    Posted Jun 12, 2019 10:03 PM

    Gents, Can someone help me to build a powercli script to fetch below details of multiple windows servers at one go and export data to excel sheet containing server name, reboot, last patched please.

    • Last time rebooted
    • Last time patched


  • 2.  RE: Script to fetch details

    Posted Jun 12, 2019 11:27 PM

    First of all, most of that would be direct Windows PowerShell and not VMware-related. Second, what have you done yourself to work towards this goal? It's generally bad form to go to any forum and ask for bespoke code be written especially for you based on your wish list.



  • 3.  RE: Script to fetch details

    Posted Jun 25, 2019 02:31 PM

    I agree with

    But never the less, let me give a hint a least, because what you want, is exactly what i scripted a year ago (and it has indeed nothing to do with PowerCLI).

    Get the latest update search + install:

    $Update_status=(New-Object -ComObject Microsoft.Update.AutoUpdate).results

    In addition, i also parse the file "c:\windows\softwaredistribution\ReportingEvents.log"

    Compute uptime of the host:

    (get-date) - (gcim Win32_OperatingSystem).LastBootUpTime | new-variable uptime

    $uptime.days

    $uptime.hours

    Now if you're familiar with PS, you could take those lines and play around in order to achieve your goal (invoke-command, etc).

    Hope it helps.