lamw
Community Manager
Community Manager

Awesome to see that you're automating this but SSH is NOT required to perform these operations nor should it be required ... especially as most customers will have SSH disabled by default

Everything you need is available via vSphere API and can be easily consumed using PowerCLI :slightly_smiling_face:

# Check whether slpd service is running on ESXi host

Get-VMHost 192.168.30.5 | Get-VMHostService | where {$_.key -eq "slpd"}

Key                  Label                          Policy     Running  Required
---                  -----                          ------     -------  --------
slpd                 slpd                           off        False    False

 

# Stop slpd service

Get-VMHost 192.168.30.5 | Get-VMHostService | where {$_.key -eq "slpd"} | Stop-VMHostService -Confirm:$false

Key                  Label                          Policy     Running  Required
---                  -----                          ------     -------  --------
slpd                 slpd                           off        False    False

 

This should simplify your automation by quite a bit :grinning_face_with_smiling_eyes:

Reply
0 Kudos