vmware-archive / powernsx

PowerShell module that abstracts the VMware NSX-v API to a set of easily used PowerShell functions
173 stars 89 forks source link

show if SSH is enabled on NSX Edge #593

Closed michaelshaoul closed 5 years ago

michaelshaoul commented 5 years ago

I would like a powershell / powercli or powernsx command to show if SSH is enabled on my NSX Edge appliances.

or an api to do the same. (This below is for the NSX Manager appliance. ) ((Invoke-NsxRestMethod -uri "/api/1.0/appliance-management/components/component/ssh"-method "get").component

componentId : SSH name : SSH Service description : Secure Shell status : RUNNING enabled : true showTechSupportLogs : false usedBy : componentGroup : SYSTEM

michaelshaoul commented 5 years ago

Get-NsxEdge | Disable-NsxEdgeSsh could also add a confirm -eq false

alagoutte commented 5 years ago

if you don't specify name for Get-NsxEdge all edge will be changed

for looking status, you need to look cliSettings on Get-NsxEdge

(Get-nsxEdge edge01).cliSettings                                 

remoteAccess userName sshLoginBannerText
------------ -------- ------------------

false        admin    ...         

and it is the remoteAccess field

a Get-NsxCliSettings will be available when #439 will be merged

michaelshaoul commented 5 years ago

thanks, that worked perfectly