CPM Plugin for Vcenter Server Appliance 6.7

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

CPM Plugin for Vcenter Server Appliance 6.7

L4 Transporter

Hi all,

 

Anyone have done this before please share with me.

I cant find it in Marketplace

 

Regards,

Viet

4 REPLIES 4

L5 Sessionator

Hi @Nhien Le​, you want to change the built-in Administrator of the VCenter application?

I have managed to do it in the past but I don't have the plugin itself anymore so I cannot share. However I still have my notes so here is how it works.

 

For password change, based on a UnixSSH CPM plugin, you log onto the machine as root (set as logon account) and you use this command to update the Administrator password:

/usr/lib/vmware-vmdir/bin/vdcpass -h <address> -u <username> -w <pmpass> -W <pmnewpass>

 

Same goes for reconciliation.

 

Verification is a bit tricky as I don't know any command to verify the password that you set with vdcpass. So for verification purposes, I spawned a script which connected to the REST API and logged on as Administrator:

https://address/rest/com/vmware/cis/session with HTTP authentication.

If you get a HTTP 200 return code, that's a success.

 

There may be a REST API call to change to password, I guess I did not find one and that's why I went with the command for change/reconcile.

Thanks mate, i will try it.

L0 Member

Hi @Sebastien Siegl​ 

 

Do you have the sinthax of Spawn API check that you used to verify?

 

Thanks

Hello @Bruno Reynaud​, I have spawn a python script to to the verification, but you could use any other language although compiled is preferred

VerifStartScript=(spawn)"D:\\Python27\\python.exe" bin\\VMWare-vCenter.py "<action>" "<address>"

It then handles the interactive retrieval of Username and Password through stdio (exchanging data with TPC, this way you can use Prompt.ini to know when to send username and then password, and you avoid passing them as arguments).

print_ex("Username:") username = raw_input() print_ex("Password:") password = raw_input()

And finally connects to the VMWare API :

headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'vmware-use-header-authn': 'jHU81YaepZp2GBEB031M', 'vmware-api-session-id': 'null', }   res = s.post('https://'+address+'/rest/com/vmware/cis/session', auth=(username,password), verify=False, headers=headers) global sessionID sessionID = res.json()["value"]   if res.status_code == 200: LogoutApi() print_ex("Success : logon successfull") else: print_ex("Failed : logon failed. Error") sys.exit()

In my Prompts.ini, I have these two to handle the return of my script and react accordingly, getting to END if it's a success or to a FAIL() state otherwise:

VerifSuccess=Success : logon successfull VerifFailed=Failed : logon failed\. Error

 

  • 1023 Views
  • 4 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!