1 2 3 4 Previous Next 54 Replies Latest reply on Jun 22, 2020 2:26 AM by LucD

    Get All information regarding ESXi Firmware Driver installed VIB

    SCharchouf Enthusiast

      Hello

       

      I'm looking for a script that can allow me to get all the below details from differentes hosts managed by differentes vCenter

       

      Firmware

      Drivers

      ESXi version

      installed VIB

      Patches

       

      Any idea? help?

        • 1. Re: Get All information regarding ESXi Firmware Driver installed VIB
          LucD Guru
          User ModeratorsvExpertCommunity Warriors

          How do you plan on combining that data?

          There will be a lot of redundant data if you at one report.

          Can this be multiple files (CSV) or a single file (HTML)?

          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 2. Re: Get All information regarding ESXi Firmware Driver installed VIB
            SCharchouf Enthusiast

            Best option is to have the date in html file in order to track changes

            the ENV; is very huge and the only way to get all details centralized is to have one single file

            • 3. Re: Get All information regarding ESXi Firmware Driver installed VIB
              LucD Guru
              User ModeratorsvExpertCommunity Warriors

              I forgot to mention one option, an XLSX file with multiple worksheets (with the ImportExcel module).
              This would make the data more accessible for other scripts (vs a HTML file).
              Would that be an option for you?

              Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
              1 person found this helpful
              • 4. Re: Get All information regarding ESXi Firmware Driver installed VIB
                SCharchouf Enthusiast

                then should be fine

                and thanks in advance for your help

                • 5. Re: Get All information regarding ESXi Firmware Driver installed VIB
                  LucD Guru
                  Community WarriorsUser ModeratorsvExpert

                  Let us start with this version, it gives the VIB info and the Patch info in 2 separate worksheets in the XLSX file.

                  Note: the script assumes you are connected to all vCenters when you run it.

                   

                  #Requires Modules ImportExcel

                   

                  $fileName = '.\report.xlsx'


                  $reportVIB = @()

                  $reportPatch = @()


                  $global:DefaultVIServers |

                  ForEach-Object -Process {

                      Get-VMHost -Server $_ -PipelineVariable esx |

                      ForEach-Object -Process {

                          $esxcli = Get-EsxCli -VMHost $esx -V2

                          $reportVIB += $esxcli.software.vib.list.Invoke() |

                          Select @{N='vCenter';E={([uri]$esx.ExtensionData.Client.ServiceUrl).Host}},

                              @{N='VMHost';E={$esx.Name}},

                              Name,ID,CreationDate,InstallDate,Version,Vendor,AcceptanceLevel


                          Get-Compliance -Entity $esx -Detailed -PipelineVariable baseline |

                          where{$_ -is [VMware.VumAutomation.Types.PatchBaselineCompliance]} |

                          ForEach-Object -Process {

                              $reportPatch += $baseline.CompliantPatches |

                              Select @{N='vCenter';E={([uri]$esx.ExtensionData.Client.ServiceUrl).Host}},

                              @{N='VMHost';E={$esx.Name}},

                              @{N='Baseline';E={$baseline.Baseline.Name}},

                              @{N='Compliant';E={$true}},

                              Name,Vendor,IdByVendor,ReleaseDate,LastUpdateTime,Severity,@{N='Product';E={$_.Product.Name}}


                              $reportPatch += $baseline.NotCompliantPatches |

                              Select @{N='vCenter';E={([uri]$esx.ExtensionData.Client.ServiceUrl).Host}},

                              @{N='VMHost';E={$esx.Name}},

                              @{N='Baseline';E={$baseline.Baseline.Name}},

                              @{N='Compliant';E={$false}},

                              Name,Vendor,IdByVendor,ReleaseDate,LastUpdateTime,Severity,@{N='Product';E={$_.Product.Name}}

                          }

                      }

                  }


                  $reportVIB | Export-Excel -Path $fileName -WorksheetName 'VIB'

                  $reportPatch | Export-Excel -Path $fileName -WorksheetName 'Patch'

                  Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                  1 person found this helpful
                  • 6. Re: Get All information regarding ESXi Firmware Driver installed VIB
                    SCharchouf Enthusiast

                    Thanks LucD

                     

                    I will do some tests and keep uou posted

                    • 7. Re: Get All information regarding ESXi Firmware Driver installed VIB
                      LucD Guru
                      vExpertCommunity WarriorsUser Moderators

                      Let me know if you need other info. We can add as many worksheets as we want (in theory).

                      Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                      • 8. Re: Get All information regarding ESXi Firmware Driver installed VIB
                        SCharchouf Enthusiast

                        tried to do test, unfortunately I got the below message

                         

                        WARNING: There were one or more problems with the Update Manager Server certificate:

                         

                        * The X509 chain could not be built up to the root certificate.

                         

                        Export-Excel : The term 'Export-Excel' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

                        At .\VIB_Firmware_Drivers_Details.ps1:75 char:14

                        + $reportVIB | Export-Excel -Path $fileName -WorksheetName 'VIB'

                        +              ~~~~~~~~~~~~

                            + CategoryInfo          : ObjectNotFound: (Export-Excel:String) [], CommandNotFoundException

                            + FullyQualifiedErrorId : CommandNotFoundException

                         

                        Export-Excel : The term 'Export-Excel' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

                        At .\VIB_Firmware_Drivers_Details.ps1:77 char:16

                        + $reportPatch | Export-Excel -Path $fileName -WorksheetName 'Patch'

                        +                ~~~~~~~~~~~~

                            + CategoryInfo          : ObjectNotFound: (Export-Excel:String) [], CommandNotFoundException

                            + FullyQualifiedErrorId : CommandNotFoundException

                         

                        by the way #Requires Modules ImportExcel is mentionned as a comment shall I remove #?

                        • 9. Re: Get All information regarding ESXi Firmware Driver installed VIB
                          LucD Guru
                          User ModeratorsvExpertCommunity Warriors

                          No that is not a comment, the #requires line states that the module is required, if it is not there the script will not run.

                          You don't seem to have the ImportExcel module installed.

                           

                          The Update Manager in your environment doesn't seem to be using a valid certificate.
                          But that seems to be a warning.

                          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                          • 10. Re: Get All information regarding ESXi Firmware Driver installed VIB
                            SCharchouf Enthusiast

                            Ok let me check and keep you posted

                            • 11. Re: Get All information regarding ESXi Firmware Driver installed VIB
                              SCharchouf Enthusiast

                              yep you are rightthe module is missing

                               

                              The script 'VIB_Firmware_Drivers_Details.ps1' cannot be run because the following modules that are specified by the "#requires" statements of the script are

                              missing: ImportExcel.

                                  + CategoryInfo          : ResourceUnavailable: (VIB_Firmware_Drivers_Details.ps1:String) [], ParentContainsErrorRecordException

                                  + FullyQualifiedErrorId : ScriptRequiresMissingModules

                               

                              $PSVersionTable.PSVersion

                               

                              Major  Minor  Build  Revision

                              -----  -----  -----  --------

                              5      0      10586  117    

                               

                              not sure how I can import it as the internet connectivity is not allowed....

                              • 12. Re: Get All information regarding ESXi Firmware Driver installed VIB
                                LucD Guru
                                Community WarriorsvExpertUser Moderators

                                You can use the Save-Module, provided you have a station somewhere that has Internet access.

                                Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                                • 13. Re: Get All information regarding ESXi Firmware Driver installed VIB
                                  SCharchouf Enthusiast

                                  the omportExcel Module is imported unfortunatly I got the below output:

                                   

                                  PS C:\path> .\VIB_Firmware_Drivers_Details.ps1

                                  At C:\path\VIB_Firmware_Drivers_Details.ps1:15 char:22

                                  + "#Requires –Modules" ImportExcel

                                  +                      ~~~~~~~~~~~~~

                                  The string is missing the terminator: ".

                                  At .\VIB_Firmware_Drivers_Details.ps1:15 char:15

                                  + "#Requires –Modules" ImportExcel

                                  +               ~~~~~~~~~~~~~~~~~~~~

                                  Unexpected token 'Modules" ImportExcel

                                  $fileName = '.\VIB_Firmware_Driver_Details\report.xlsx'

                                  $reportVIB = @()

                                  $reportPatch = @()

                                  $global:DefaultVIServers |

                                  ForEach-Object -Process {

                                      Get-VMHost -Server $_ -PipelineVariable esx |

                                      ForEach-Object -Process {

                                          $esxcli = Get-EsxCli -VMHost $esx -V2

                                          $reportVIB += $esxcli.software.vib.list.Invoke() |

                                          Select @{N='vCenter';E={([uri]$esx.ExtensionData.Client.ServiceUrl).Host}},

                                              @{N='VMHost';E={$esx.Name}},

                                              Name,ID,CreationDate,InstallDate,Version,Vendor,AcceptanceLevel

                                          Get-Compliance -Entity $esx -Detailed -PipelineVariable baseline |

                                          where{$_ -is [VMware.VumAutomation.Types.PatchBaselineCompliance]} |

                                          ForEach-Object -Process {

                                              $reportPatch += $baseline.CompliantPatches |

                                              Select @{N='vCenter';E={([uri]$esx.ExtensionData.Client.ServiceUrl).Host}},

                                              @{N='VMHost';E={$esx.Name}},

                                              @{N='Baseline';E={$baseline.Baseline.Name}},

                                              @{N='Compliant';E={$true}},

                                              Name,Vendor,IdByVendor,ReleaseDate,LastUpdateTime,Severity,@{N='Product';E={$_.Product.Name}}

                                              $reportPatch += $baseline.NotCompliantPatches |

                                              Select @{N='vCenter';E={([uri]$esx.ExtensionData.Client.ServiceUrl).Host}},

                                              @{N='VMHost';E={$esx.Name}},

                                              @{N='Baseline';E={$baseline.Baseline.Name}},

                                              @{N='Compliant';E={$false}},

                                              Name,Vendor,IdByVendor,ReleaseDate,LastUpdateTime,Severity,@{N='Product';E={$_.Product.Name}}

                                          }

                                      }

                                  }

                                  $reportVIB | Export-Excel -Path $fileName -WorksheetName 'VIB'

                                  $reportPatch | Export-Excel -Path $fileName -WorksheetName 'Patch'' in expression or statement.

                                      + CategoryInfo          : ParserError: (:) [], ParseException

                                      + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

                                  • 14. Re: Get All information regarding ESXi Firmware Driver installed VIB
                                    LucD Guru
                                    User ModeratorsvExpertCommunity Warriors

                                    There seem to be some funny characters on this line


                                    #Requires –Modules" ImportExcel

                                     

                                    That should be

                                     

                                    #Requires "Modules" ImportExcel

                                     

                                    Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                                    1 2 3 4 Previous Next