VMware Cloud Community
MartinAmaro
Expert
Expert
Jump to solution

ESXi 4.1+howto enable TSM in multiple hosts?

The command below will enable Tec Support Mode (SSH) in one host

Set-VMHostService -HostService (Get-VMHostService -VMHost hostname | where {$_.key -eq “TSM-SSH”}) -Policy “Automatic”

How can you enable TSM for multiple hosts

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful.
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Can't you do this in a pipeline construction like this ?

Get-VMHost | Get-VMHostService | where {$_.key -eq “TSM-SSH”} | Set-VMHostService -Policy “Automatic”

And then you select the hosts you want with another Where-Object after the Get-VMHost.

Get-VMHost | where{$_.Name -like "Srv1*"} | Get-VMHostService | where {$_.key -eq “TSM-SSH”} | Set-VMHostService -Policy “Automatic”

This should change the service for all hosts whose name starts with "Srv1"

____________

Blog: LucD notes

Twitter: lucd22


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

View solution in original post

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Can't you do this in a pipeline construction like this ?

Get-VMHost | Get-VMHostService | where {$_.key -eq “TSM-SSH”} | Set-VMHostService -Policy “Automatic”

And then you select the hosts you want with another Where-Object after the Get-VMHost.

Get-VMHost | where{$_.Name -like "Srv1*"} | Get-VMHostService | where {$_.key -eq “TSM-SSH”} | Set-VMHostService -Policy “Automatic”

This should change the service for all hosts whose name starts with "Srv1"

____________

Blog: LucD notes

Twitter: lucd22


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

Reply
0 Kudos
MartinAmaro
Expert
Expert
Jump to solution

Never mind

$VMhosts = Get-Cluster | Get-VMhost

foreach ($VMhost in $VMhosts)

{

Set-VMHostService -HostService (Get-VMHostService -VMHost $VMhost | where {$_.key -eq “TSM-SSH” -and $._Policy -eq "off"}) -Policy “Automatic”

}

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful.
Reply
0 Kudos