VMware Cloud Community
gunnarb
Expert
Expert
Jump to solution

vCLI and Domain Credentials

This forum is extremely buried so I'm not sure how active it is, but I've been scouring the vCLI reference guide trying to figure out a way to run vicfg-backup.pl with domain credentials. From my understanding I can use a session file or a config file to simply the login process. I have figured out the config file but not the session file, but I'm only able to use accounts local to the esx server. I'm assuming I need to first connect to the vCenter server then from there connect to an ESX server but I'm not sure. Whatever works is cool with me.

Any help would be appreciated.

-Gunnar

Gunnar Berger http://www.gunnarberger.com http://www.endusercomputing.com
0 Kudos
1 Solution

Accepted Solutions
vincentho
VMware Employee
VMware Employee
Jump to solution

No session file does not store the credential. It only contains the session cookie and the session does timeout after awhile.

View solution in original post

0 Kudos
7 Replies
gunnarb
Expert
Expert
Jump to solution

Okay I figured out the session file as well, heck that was easier than the config file and at least that gives you a way of storing a password without it being in clear text. Still would like to find a way to use domain credentials though.

Gunnar Berger http://www.gunnarberger.com http://www.endusercomputing.com
0 Kudos
gunnarb
Expert
Expert
Jump to solution

Well I just learned that session files expire. I'm trying to back up my servers on as a scheduled task, my script looks like this:

"C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\vicfg-cfgbackup.pl" --sessionfile C:\esx\esx01.session --save
server\Backups\ESX\ESX01-Backup

It worked great initially but on the second pass an hour later it failed with this error:

Error: The session is not authenticated.

I need a way to run this every day but don't like that the config file stores the password in clear text.

-Gunnar

Gunnar Berger http://www.gunnarberger.com http://www.endusercomputing.com
0 Kudos
vincentho
VMware Employee
VMware Employee
Jump to solution

You can use domain credentials if the vCLI is connecting through vCenter. Unfortunately, the vicfg-cfgbackup does not

support vCenter connection. Your other alternative is to run vCLI from vMA which you don't need to authenticate again.

gunnarb
Expert
Expert
Jump to solution

Is there any way to have a session file remember it's credentials? I like that those files don't have the password in clear text, as oppposed to the .config file.

Gunnar Berger http://www.gunnarberger.com http://www.endusercomputing.com
0 Kudos
vincentho
VMware Employee
VMware Employee
Jump to solution

No session file does not store the credential. It only contains the session cookie and the session does timeout after awhile.

0 Kudos
gunnarb
Expert
Expert
Jump to solution

%$&@!!!!

Well thanks for in the info.

-Gunnar

Gunnar Berger http://www.gunnarberger.com http://www.endusercomputing.com
0 Kudos
tdubb123
Expert
Expert
Jump to solution

what happens after the session file expires? A new one needs to be created again?

0 Kudos