VMware Cloud Community
dtracey
Expert
Expert

Remove Computer Object from AD Group

Hi Guys,

We use AD Groups to manage SCCM Patching and Reboot windows, and I need to write a workflow to remove an AD Computer objectfrom a particular AD group as part of a wider workflow.  Seems simple enough, but i'm having an issue with it.  I have 2 inputs:


computerGroup - Type: AD:UserGroup

computer - Type: AD:ComputerAD

I'm trying to use the removeElements method of the AD:UserGroup object:

computerGroup.removeElements(computer);

but am seeing an error:

rror in (Workflow:Remove computer from groups / Remove members (item0)#7) Cannot convert #_v2_#,#Computer#,#6cc0881b-5a46-48a1-8038-a1be10e7f46c#,#CN=<REMOVED>,OU=<REMOVED>,OU=<REMOVED>,DC=net,DC=<REMOVED>,DC=<REMOVED>,DC=<REMOVED># to ch.dunes.ad.object.interfaces.IADBase[]

[2016-11-30 13:43:40.562] [E] Workfow execution stack:

***

I use a very similar script to remove user objects from AD groups without any issues.  I can return allAttributes of the computerGroup object, and enumerate it's members etc.

Any ideas?


Thanks,


Dan

0 Kudos
1 Reply
dtracey
Expert
Expert

Please ignore - just realised that the removeElements method requires an array of Objects as an input - NOT an object.

Schoolboy error!

Please feel free to delete!

Cheers,


Dan

0 Kudos