How to add Target Servers to vMA

I have had this one post sitting around for a while and I figured I should get it written before it gets lost.

Earlier I was working on getting vMA stood up in my lab environment and I figured that I should do a post about how to configure vMA to connect to a target. Adding a Target Server in vMA is a faster way for you to be able to issue commands. Rather than having to specify which server you want to run commands against (especially if you are running several commands on the same box) you should set the server as a target. In this instance I will run through the steps of setting a target for an AD Authenticated host or vCenter. 

From the vMA console you will type the following command out:

vifp addserver <vcenter server name.domain.local> –authpolicy adauth –username <AD DOMAINUserName>

and press Enter and you will be prompted for the Password of the AD account that you referenced.

To verify that the server is connected you can use the following command:
vifp listservers –long

This will tell you the server name as well as the method of authentication. Now anytime you want to run a command against that host you will be able to do so without having to re-authenticate every time.

To set your Target server you can use the following command prior to running your actual command or script.

vifptarget -s <servername>

How to add vMA to Windows AD Domain

While working in my lab at work I wanted to see about adding my vSphere Management Assistant (vMA) to our lab Active Directory so it would be easier for me to connect to resources. After going through the process I decided to make a guide on the steps I took to get it working.

Just an FYI I was working with vSphere Management Assistant version at the time of taking these screenshots so I am sure things may have changed in later versions… or not.

First you will need to get to the console of the machine.

Select the option to login

and log in using the vi-admin account

Once you are logged in you are presented with a command prompt. You will need to use the following command to add your appliance to a Windows domain.

Sudo domainjoin-cli join <> <Domain User Name>

You will then be prompted for the vi-admin password

Once your Appliance is added to the domain you will see a screen like this.

Once the reboot has been completed you will can verify that you are on the domain by running this command:
sudo domainjoin-cli query
and you will be presented with a response something line this
Now your appliance is on the domain and you will now have an easier time connecting to resources in your VMware environment.