Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Delete computer from AD by name

$
0
0

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:

 

http://www.vcoteam.info/articles/learn-vco/259-remove-computer-from-ad-using-vco-during-vcac-decommission.html

 

varcomputers = ActiveDirectory.getComputerADRecursively(computerName);

//System.log("Computer count: "+computers.length);

foreach (pc incomputers){

    //System.log("Checking computer: "+pc.name);

    if(computerName.toLowerCase() == pc.name.toLowerCase()){

        //System.log("Found Computer: "+pc.name);

        returnpc;

    }

}

 

// 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?)


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>