HI,
I would like to create a little workflow to set AD and local description of computer.
if someone have an idea....
thank you in advance
Please review the scriptable task, inputs, and bindings of the attached workflow that I created when originally answering your question...
You may import the attached workflow and test/modify it as desired.
Workflow Inputs:
computerAD (AD:ComputerAD) -- this is the computer object in the AD plug-in that will have its description field modified
newDescription (string) -- the new value of the description for the selected computer object
Scriptable task:
The scriptable task input has both of the workflow Inputs bound to it allowing access to these values within the script.
Hi,
I don't think that is possible using the AD Plugin for vCO (because this doesn't expose the functionality).
However, nothing is impossible in vCO, you just have to be more creative...
My next try would be: Use the Powershell plugin to call out to a powershell script that does the job. Quick google found some examples, I'm sure there are plenty more: http://dmitrysotnikov.wordpress.com/2007/07/25/set-any-ad-attribute-with-powershell/
http://stackoverflow.com/questions/6603519/modify-attributes-in-ad-via-powershell-no-quest
Cheers,
Joerg
Assuming you have the Active Directory plug-in installed and have the appropriate permissions, the following code will allow you to set the new description of the computer object.
Inputs: computerAD (AD:ComputerAD), newDescription (string)
System.log("Old Description: "+computerAD.getAttribute("description"));
System.log("Setting new description...");
computerAD.setAttribute("description",newDescription);
The above code, when placed into a workflow with the inputs bound, will prompt you for a computerAD object and Description. Upon submitting, the code will display the current description, then proceed to set the new description as defined.
This code addresses the computer object in AD, I'm unsure what you mean by "Local"
If I understood, I need to create an action with your code proposed ?
No need to create an action (you could do so if you plan to reuse that in multiple workflows, though).
You can just use a "Scriptable Task" element in the workflow, and add Burke's example there.
I tried to use the exemple code to create an action but I'm beginner and it doesn't work.
If you can help me to create this
At the end, this action must set the description of computer AD and the local description
thanks in advance
Please review the scriptable task, inputs, and bindings of the attached workflow that I created when originally answering your question...
You may import the attached workflow and test/modify it as desired.
Workflow Inputs:
computerAD (AD:ComputerAD) -- this is the computer object in the AD plug-in that will have its description field modified
newDescription (string) -- the new value of the description for the selected computer object
Scriptable task:
The scriptable task input has both of the workflow Inputs bound to it allowing access to these values within the script.
Cool it is working fine !!!
But now I have a little pb because if I want to integrate to my original workflow (see attachement) I need to set automaticaly the ComputerAD.
I think to place the WF "set Computer..." just after "Create a computer..." but how to set the ComputerAD ?
You need to get the computer name and pass it to an action that will retrieve the computerAD object for you. You can find this action (getComputerADbyName) in the package attached to my article here: Remove computer from AD using vCO during vCAC Decommission
Hello,
I found a solution by myself :smileygrin:
I created a little action with this script :
var ArrayComputer = new Array();
ArrayComputer.push(ComputerName);
return ArrayComputer;
ComputerName are a parameters Type :AD:ComputerAD
Thanks for your help