Automation

 View Only
  • 1.  script to output hyper threading settings to a csv file??

    Posted Jul 08, 2019 07:07 PM

    Looking for a script that will run against all hosts in a vCenter server and output the hyper threading settings to a csv file.

    Specifically looking for state of:

    UserVars.SupressHyperthreadwarning

    VMkernel.Boot.hyperthreading

    VMkernel.Boot.HyperthreadingMitigation

    I'm sure it's probably an easy thing for those who have done a lot more with PowerShell/PowerCLI.  :smileywink:



  • 2.  RE: script to output hyper threading settings to a csv file??
    Best Answer

    Posted Jul 08, 2019 07:28 PM

    Try like this

    Get-VMHost |

    Select Name,

    @{N = 'UserVars.SuppressHyperthreadWarning'; E = { (Get-AdvancedSetting -Entity $_ -Name 'UserVars.SuppressHyperthreadWarning').Value } },

    @{N = 'VMkernel.Boot.hyperthreading'; E = { (Get-AdvancedSetting -Entity $_ -Name 'VMkernel.Boot.hyperthreading').Value } },

    @{N = 'VMkernel.Boot.HyperthreadingMitigation'; E = { (Get-AdvancedSetting -Entity $_ -Name 'VMkernel.Boot.HyperthreadingMitigation').Value } } |

    Export-Csv -Path .\report.csv -NoTypeInformation -UseCulture

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

    Was it helpful? Let us know by completing this short survey here.



  • 3.  RE: script to output hyper threading settings to a csv file??

    Posted Jul 08, 2019 07:36 PM

    Thanks LucD... As always, quick to come up with a working solution to what's requested. Now we have a way to get the list...

    One quick question... Is there an easy way to have the report.csv file name have the vCenter name in it (at the start)?? That way if it's decided to run this through automation, we can have the report named correctly and not have them write over each other. :smileywink:



  • 4.  RE: script to output hyper threading settings to a csv file??

    Posted Jul 08, 2019 07:40 PM

    Sure, something like this?

    $reportName = ".\HT-report-$($global:DefaultVIServer.Name).csv"

    Get-VMHost |

    Select Name,

    @{N = 'UserVars.SuppressHyperthreadWarning'; E = { (Get-AdvancedSetting -Entity $_ -Name 'UserVars.SuppressHyperthreadWarning').Value } },

    @{N = 'VMkernel.Boot.hyperthreading'; E = { (Get-AdvancedSetting -Entity $_ -Name 'VMkernel.Boot.hyperthreading').Value } },

    @{N = 'VMkernel.Boot.HyperthreadingMitigation'; E = { (Get-AdvancedSetting -Entity $_ -Name 'VMkernel.Boot.HyperthreadingMitigation').Value } } |

    Export-Csv -Path $reportName -NoTypeInformation -UseCulture



  • 5.  RE: script to output hyper threading settings to a csv file??

    Posted Jul 08, 2019 07:54 PM

    Perfect... :smileyhappy: