This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cred = Server.getCredential(); | |
vmPassword = VcPlugin.createCustomizationPasswordFromCredentials(cred, true).value; | |
vmUsername = cred.username; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
set logfolder="%cd%\logs" | |
set logfile="%logfolder%\install.log" | |
if not exist %logfolder% mkdir %logfolder% | |
set root=%cd% | |
FOR %%F IN (%root%\*vro*.zip) DO ( | |
set zipfile=%%F |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright (c) 2015-2016 VMware, Inc. All rights reserved. | |
# | |
# Description: VMware vRealize Automation and Software Services agents installation script | |
# Modified on April 20th, 2017 by Burke Azbill to support execution on PhotonOS 1.0 GA | |
# Global Constants | |
[ -z $GUGENT_INSTALL_PATH ] && GUGENT_INSTALL_PATH=/usr/share/gugent | |
JRE_RELEASE=1.8.0_112 | |
DEFAULT_JAVA=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Authors: Burke Azbill & Bill Call (2011) | |
Name: sortDatastores.action | |
Description: This script is intended to be used as a vRealize Orchestrator Action. It will return an array of sorted VC:Datastore objects, | |
sorted as defined by the sortType input (freeSpace, freeSpaceDesc, capacity, capacityDesc, uncommitted, uncommittedDesc, nameDesc) | |
where "Desc" means Descending. If no Sort Type is defined, then the default sort is by Name. | |
This code also serves as an example on how to sort arrays of Objects in vRealize Orchestrator | |
Inputs: datastores (Array/VC:Datastore), sortType (string), logResults (boolean) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Here's a quick one-liner to get a user by name. | |
// Inputs: username (string), adHost (AD:AdHost) - "adHost" host param optional. If not specified, only the default AD host is searched. | |
// Output: user (AD:User) | |
// Option 1: quick 1-liner | |
user = ActiveDirectory.searchExactMatch("User", username, 1, adHost)[0]; | |
// Option 2: If you want a bit more error handling, try this: | |
/* | |
var users = ActiveDirectory.searchExactMatch("User" , UserID, 1, adHost); | |
for each (usr in users){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stripQuotes(quoteString){ | |
return quoteString.replace(/\”/g,””); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stripBrackets(string) { | |
return string.replace(/\[/g, "").replace(/\]/g, "").replace(/\"/g, ""); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Working with Orchestrator Properties objects is actually pretty easy. See the API Explorer for full details. | |
The object has a keys property that is an array of strings containing the name of each available property. | |
*/ | |
// Manually defining a simple set of properties here. The first value in the put() is a String containing the name of the property | |
// the second value is the actual value - this can be any object type Orchestrator understands | |
// Initialize a new Properties object | |
var payload = new Properties(); | |
// Populate the properties object with a few key/value pairs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Burke Azbill | |
Purpose: Display various properties of a vCloud:Gateway object in vRealize Orchestrator (vRO) | |
Usage: | |
1) Create a new workflow with a single scriptable task in it | |
2) Add an input named "gateway" of type "vCloud:Gateway" and be sure the input is bound to the scriptable task | |
3) Paste this code into the scriptable task | |
4) Save and Close | |
5) Run the workflow, providing a valid vCloud:Gateway object as input | |
6) Review the Logs tab of your vRealize Orchestrator client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This script is for use with VMware vRealize Orchestrator | |
Assumes the Active Directory plug-in is installed/configured | |
Input: user (AD:User) | |
Output: passwordDate (Date) | |
*/ | |
function getPasswordDate(user){ | |
var lastPasswordSet = user.getAttribute("pwdLastSet"); | |
var unixTime = (lastPasswordSet - 116444736000000000) / 100000; | |
var passwordDate = new Date(Math.round(unixTime)); |
NewerOlder