Today Duncan over at yellow-bricks.com has started quite the conversation on technical support mode for ESXi or otherwise known as “unsupported mode”, check out his blog post and especially the comments here:  http://www.yellow-bricks.com/2010/03/01/disable-tech-support-on-esxi/

As always when I see a post my first thought is to PowerCLI, so how can it help in this instance, well apart from the obvious cmdlets which I mentioned in my earlier ESXi post, there are also a couple of one liners which can help us manage Technical Support mode.

To view all hosts and check to see if they have Technical Support mode enabled, use the following:

Get-VMHost | Where {$_.State -eq "Connected" -or $_.State -eq "Maintenance"} | Get-View | Where {$_.Summary.Config.Product.Name -match "i"} | Select Name, @{N="TechSuportModeEnabled";E={(Get-VMHost $_.Name | Get-VMHostAdvancedConfiguration -Name VMkernel.Boot.techSupportMode).Values}} | Out-GridView

image

To disable it on all ESXi hosts use the following:

Get-VMHost | Where {$_.State -eq "Connected" -or $_.State -eq "Maintenance"} | Get-View | Where {$_.Summary.Config.Product.Name -match "i"} | Get-VIObjectByVIView | Set-VMHostAdvancedConfiguration -Name VMkernel.Boot.techSupportMode -Value $false

And to enable it use the following:

Get-VMHost | Where {$_.State -eq "Connected" -or $_.State -eq "Maintenance"} | Get-View | Where {$_.Summary.Config.Product.Name -match "i"} | Get-VIObjectByVIView | Set-VMHostAdvancedConfiguration -Name VMkernel.Boot.techSupportMode -Value $true

Thanks to Duncan and his most excellent site for the constant source of script ideas ;)