Hi,
i'm trying to edit the destroyElement AD workflow to accept computer in string format.
I've added a scriptable task before the destroyElement action and entered the code from this post:
var
computers = ActiveDirectory.getComputerADRecursively(computerName);
//System.log("Computer count: "+computers.length);
for
each (pc
in
computers){
//System.log("Checking computer: "+pc.name);
if
(computerName.toLowerCase() == pc.name.toLowerCase()){
//System.log("Found Computer: "+pc.name);
return
pc;
}
}
// Nothing found so throw exception:
throw
"No matching Computer found: "
+ computerName;
swapping out variables for my own and make sure all bindings and input params are correct.
however, i get an error stating "Default Active Directory server not set. (Workflow:CB - Destroy a computer / Find computer in AD (item1)#54823)", even though i've run the ad configuration workflow to set this.
how do I get around this, preferably by entering the default host into the script so I can use the script for different domains? (as far as i can tell the AD configuration task to set the default AD host can only be run for 1 domain?)