Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

No change ESG or DLR admin password from PowerNSX #431

Closed
kevsterd opened this issue Nov 14, 2017 · 9 comments · Fixed by #439
Closed

No change ESG or DLR admin password from PowerNSX #431

kevsterd opened this issue Nov 14, 2017 · 9 comments · Fixed by #439

Comments

@kevsterd
Copy link

Whilst it is possible to change credentials from GUI or API, PowerNSX does not expose the element of meaning passwords cannot be changed.

@alagoutte
Copy link
Contributor

Hi,

Can you try
PS C:> $edge = Get-NsxEdge Edge01
PS C:> $edge.cliSettings.password = "MySuperVmware1!Password"
PS C:> $edge | Set-NsxEdge

@kevsterd
Copy link
Author

Nope. I'd tried that. Get a property 'password' cannot be found on this object.

If you look at the XML returned from an ESG there is no password shown, although I know via the actual API/Curl you can submit to /api/4.0/edges/EDGEID/clisettings with a password element.

@alagoutte
Copy link
Contributor

Ok, need to add a XML Element

@nmbradford
Copy link
Contributor

@kevsterd - try this - it uses the add-xmlelement PowerNSX internal function to make adding simple text elements easy as @alagoutte is eluding to.

#Get the edge you want to modify
$edge = get-nsxedge myedge

#Add the xml text element to the cliSettings element
Add-XmlElement -xmlRoot $Edge.CliSettings -xmlElementName "password" -xmlElementText "SuperSecretPassword!VMware1!"

#Show it (optional)
$edge.cliSettings.password
SuperSecretPassword!VMware1!

#Push update back to API. (Note you will get an error if the pwd does not meet complexity requirements)
$edge | Set-NsxEdge

@kevsterd
Copy link
Author

@nmbradford Yes that appears to work. Handy method to use where functions don't exist for other elements.

Whilst a lot of sites don't probably need it, it may be a nice to have along with the banner text and others.

@alagoutte
Copy link
Contributor

i will try to implement a Get-clisettings / Set-cliSettings (but in next week...)

@alagoutte
Copy link
Contributor

Hi @kevsterd

i have push a PR with 2 new cmdlets to work with cliSettings

@kevsterd
Copy link
Author

@alagoutte did this ever get integrated ?

@alagoutte
Copy link
Contributor

@kevsterd patches don't yet merged...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants