I'm working on a Windows provisioning workflow in vCO. In the interest of security, users have a domain admin level user and their normal user account that has been granted VMware/vCenter privileges. The normal account cannot perform any domain activities (creating security groups/adding computers to the domain), and the domain admin account cannot access vCenter.
I'd like a single workflow that will prep AD for a new server add (requires domain admin privs), then deploy a template/sysprep (requiring vCenter privs), and lastly joining the domain (Domain Admin privs again).
I know that I can use the "Run As" functionality for a single workflow, but is it possible to prompt the user for their admin credentials, then in a single workflow call the required AD workflows, followed by running the vCenter workflows, and lastly the AD workflows again with their domain admin creds?
Thanks!
Within a workflow you can use the Change Credential palette item (found under basic) to run the next operations with a different user.
Within a workflow you can use the Change Credential palette item (found under basic) to run the next operations with a different user.
I use this code to start a WF with different credentials in a current running WF
'wf' is a variable of type 'Workflow'
var prop = new Properties();
var token = new WorkflowToken();
//Execute workflow
try {
token = wf.execute(prop,username,password);
} catch (NullPointerException) {
Output = "Incorrect username/password";
System.log (Output);
throw Output;
}
//Wait for workflow completion
var complete = false;
while(complete == false){
if(token != null && (token.state != "running" && token.state != "waiting")){
var outputProp = token.getOutputParameters();
run = outputProp.get("run");
//System.log (run);
complete = true;
}
}
if (run == null)
{
if (token.logEvents[0].shortDescription == "Workflow has failed")
{
throw token.logEvents[0].longDescription;
}
}