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

Adding a VM to an AD group during provisioning

$
0
0

We have a handful of AD groups used to patch Windows on various schedules.  I have a drop down that asks the user when they would like to patch and then I pass on the variables to a PS script. This works fine but it just bugs me that I have to use that PS script when I have everything else within vRO.  I did some googling and found one posting about this same thing back in 2015.  I took that code and some of my own and produced what I thought was a solid script.  However when it runs I get this message:

 

Error in (Workflow:JustTheProps / Scriptable task (item1)#74) TypeError: Cannot find function addElements in object DynamicWrapper (Instance) : [AD_UserGroup]-[class ch.dunes.ad.object.UserGroup] -- VALUE : #_v2_#,#UserGroup#,#012827d2-77fb-435f-bf6e-8fff3fcf4e76#,#XXXXXXXXXXXXXXXX

[2017-09-29 14:19:10.862] [E] Workflow execution stack:

***

item: 'JustTheProps/item1', state: 'failed', business state: 'null', exception: 'TypeError: Cannot find function addElements in object DynamicWrapper (Instance) : [AD_UserGroup]-[class ch.dunes.ad.object.UserGroup] -- VALUE : XXXXXXXXXX. (Workflow:Patching / Scriptable task (item1)#74)'

 

 

This is where the code bombs:

if (index == -1){

userGroup.addElements(computers);

System.debug(computerAD.name+" is added to group "+ userGroup.name);

}

else System.debug("Server is member of group "+userGroup.name);

 

Has anyone run into something similar and have an idea what needs to be looked at?


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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