VMware Cloud Community
HDas
Contributor
Contributor

Provide Manager Approval in Self provisioning WF

Hello There,

I want to provide a manager approval in a VM self Provisioning WF.

I have seen some links on the web , but weren't of much help to me.

When a user requests for a VM , there should an email automatically triggered and sent to his manager for approval.

It can be done by querying the "manager" attribute in Active directory. (We have AD infra).

How can we achieve this ? I have installed the AD plugin .

Will the AD plugin API's help me ?

Is it possible ?

Reply
0 Kudos
6 Replies
igorstoyanov
VMware Employee
VMware Employee

You may start by reading those two blog posts about approvals. It is related to vCloud not vCenter but the concept is the same:

Visit http://blogs.vmware.com/orchestrator for the latest in Cloud Orchestration.
Reply
0 Kudos
HDas
Contributor
Contributor

Thank You for replying.

But I really do not want to go the vCloud or vDirector way.

All I am interested in now is the "Use Active Directory to find the manager and email to send notification mail" part.

And this to be achieved using VOrchestrator

Reply
0 Kudos
tschoergez
Leadership
Leadership

Hi!

In one of the links Igor posted before you can find the general flow how to achieve this: Use the "Send interaction"-workflow from the library to send and email, and use an "user interaction"-element to pause the workflow until approval.

To figure out the manager in AD: I don't know from mind if this is an attribute provided to the workflow when using the AD-Plugin. In one of my projects I went for "adfind", a small freeware tool which allows any query against AD you can think of. See the example here:

http://www.vcoportal.de/2011/08/small-but-useful-command-line-tools-for-vco-workflows/

Cheers,

Joerg

Reply
0 Kudos
Burke-
VMware Employee
VMware Employee

If you have the AD plug-in installed, the requester is an AD user, and the Approver is the AD User's "Manager" as defined in Active Directory, then yes, you can get the manager's distinguished name. Once you have that, you can search AD for the AD:User account that matches that DN and once you have the object, you can use the getAttribute("mail"); method to return the e-mail address of the manager Smiley Wink

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you!

Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator
for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
Burke-
VMware Employee
VMware Employee

And here's the script to do what I describe Smiley Wink Assuming the input is "requester" of type (AD:User):

var managerDN = requester.getAttribute("manager"); // returns the Distinguished Name of the Manager as defined by Active Directory
var manager = Server.findForType("AD:User", "User:"+managerDN);
if (manager != null){
     var managerMail = manager.getAttribute("mail");
     System.log("Manager: "+manager.accountName+" ("+managerMail+")");
}

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you!

Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator
for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
HDas
Contributor
Contributor

Haven't got a chance to implement.

But I found it verylogical.

Thank You so much !

Reply
0 Kudos