VMware Cloud Community
golddiggie
Champion
Champion
Jump to solution

script to output hyper threading settings to a csv file??

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.  Smiley Wink

Tags (1)
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

4 Replies
LucD
Leadership
Leadership
Jump to solution

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

golddiggie
Champion
Champion
Jump to solution

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. Smiley Wink

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

golddiggie
Champion
Champion
Jump to solution

Perfect... Smiley Happy

Reply
0 Kudos