PowerCLI

 View Only
  • 1.  View SSH Status on hosts

    Posted May 03, 2018 03:51 PM

    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



  • 2.  RE: View SSH Status on hosts
    Best Answer

    Posted May 03, 2018 03:59 PM

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



  • 3.  RE: View SSH Status on hosts

    Posted May 03, 2018 06:35 PM

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