VMware Cloud Community
Skagnola
Enthusiast
Enthusiast
Jump to solution

View SSH Status on hosts

Hello!

I am trying to create a function to view the status of SSH on a set of hosts. I kinda narrowed down what I want to see with this...

$VMHost.ExtensionData.Config.Service.Service

... but that lists every service on the host, and it does not show the actual VMHost Name.

Basically I'm looking for this...

Get-HostsSSH

... to yield

Name                                             

----

vmhost.local

Key           : TSM-SSH

Label         : SSH

Required      : False

Uninstallable : False

Running       : False

Ruleset       :

Policy        : off

SourcePackage : VMware.Vim.HostServiceSourcePackage

Name

___

vmhost2.local

Key           : TSM-SSH

Label         : SSH

Required      : False

Uninstallable : False

Running       : False

Ruleset       :

Policy        : off

SourcePackage : VMware.Vim.HostServiceSourcePackage

0 Kudos
1 Solution

Accepted Solutions
Zsoldier
Expert
Expert
Jump to solution

(Get-VMHost | Get-VmHostService | Where-Object {$_.key -eq "TSM-ssh"} | Select VMHost, Policy, Running)

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier

View solution in original post

0 Kudos
2 Replies
Zsoldier
Expert
Expert
Jump to solution

(Get-VMHost | Get-VmHostService | Where-Object {$_.key -eq "TSM-ssh"} | Select VMHost, Policy, Running)

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
0 Kudos
Skagnola
Enthusiast
Enthusiast
Jump to solution

Thanks, Zsoldier. That got me what I was looking for.

0 Kudos