Customization General vCloud

vRealize Automation (vRA) 6.2 Pre-Req Automation Script (Formerly vCAC)

As the Pre-Req Automation Script has been such a hit over the past 12 months I continue to update it for the requirements of each release of vCloud Automation Center and now vRealize Automation. I have received scores of emails and tweets telling me how it saved the users hours of hassle. And so here I am, releasing a Pre-Req Automation Script for vRA 6.2 which is now Generally Available on MyVMware.

The new version can be grabbed from Github HERE. For those that are new to Github you CANNOT just right-click on this link and hit ‘save as’. that will not work. You will want to click on the file, choose “Raw” and copy the script to a .ps1 file on your machine. (There were several comments on my previous blogs about the confusion of downloading the script)

How to use the script

There are a few new options in this script that I added last version, but didn’t take the time to really blog about. So let’s get into it. If the script is run “out of the box” you’ll be presented with something like this:

Screenshot 2014-12-09 10.53.31

This menu shows up if the user has not pre-set the script variables before running the script. This is just fine, but you will receive prompts throughout the duration of the script.

Each menu that pops up gives essentially the same options:

  1. (1) is selected if you already have the file being requested and just need to point the script to the file
  2. (2) is selected if you do not already have the file and you want the script to go out to the internet and grab it and execute automatically
  3. (3) will exit the script

If you select (1) and the file is not automatically found, it will prompt you for its location.

Screenshot 2014-12-09 10.53.43

Selecting (2) will do it all for you as you can see below:

Screenshot 2014-12-09 10.54.02

To set the Secondary Logon Service and Batch Logon requirements, the NTRights.exe file must be used to do this in an automated fashion. This file is only found in the Windows 2003 Resource Kit.

Screenshot 2014-12-09 11.09.24

Choosing Menu item (2) will download the resource kit (~11MB), unzip, and use ntrights.exe.

Screenshot 2014-12-09 11.09.32

Once the file has been downloaded and extracted, the script will ask for the user account to add to these services. Make sure to follow the example of using host\user_account

Screenshot 2014-12-09 11.10.06

Java is then installed. Follow the menu items and continue

Screenshot 2014-12-09 11.10.14

Once Java has been installed, it will also set the Java_HOME variable automatically.

Screenshot 2014-12-09 11.12.23

The Pre-Reqs are now complete. Much easier than doing it all manually, right? How would you like to have the entire script automated (no menu prompts)? Read on!

If you open the script before running it, you will see a section at the top of the code named “USER CONFIGURATION”

All of the menus options can be set here. Read the comments above each variable and update the variable accordingly. Each variable $_____menuoption are the variables that prompt for how to proceed with each step of the installer. As you can see below, I’ve added “2” to each menu item, meaning I want the script to download each file for me automatically. I don’t want to have to do ANYTHING.

The only other variable I need to populate to have a fully-automated script is the $domainAdminAcct variable needing the account that will be used for the Secondary Logon and Batch Logon services.

Screenshot 2014-12-09 11.13.43

Once those are set, you can then run the script, sit back, and spend some time on Twitter or Reddit Smile.


14 comments have been added so far

  1. I found that when running this script on Windows Server 2012 R2 I encountered the error “Test-Path : A parameter cannot be found that matches parameter name ‘eq’.” on lines 233, 408 and 490. The fix was to surround the Test-Path statement with round brackets as PowerShell is interpreting “-eq $false” as part of the command and not as a boolean expression. For example:

    if (($InstallSource -eq “”) -or ( Test-Path -Path “$InstallSource” -ErrorAction SilentlyContinue -eq $false)) {

    if (($InstallSource -eq “”) -or ( (Test-Path -Path “$InstallSource” -ErrorAction SilentlyContinue) -eq $false)) {

  2. Brian – Thanks for this! It DOES save tons of work! Is there any way to change the logic around the JAVA_HOME variable? If I use Java 8, then I have to manually reset it.

  3. Hey Brian,

    When I run this script, it keep throwing error below and wouldn’t run, am I missing anything, please suggest.

    The ‘<' operator is reserved for future use.
    At C:\tmp\vRA 6.2 PreReq Automation Script.ps1:290 char:114
    + … l_selector=http&protocol_type=clone" class="inline-form js-clone-selector-fo …


Leave a Reply

Your email address will not be published. Required fields are marked *