Hi,
I came across this in the SDK for setting the OU in a Business Rule before object creation
$destOU = $Context.Action.TargetContainer
if ($destOU.AdsPath.Contains("Marketing Users"))
{
$newDN = "OU=Marketing Department,DC=company,DC=com"
$newDestOU = $Context.BindToObjectByDN(newDN)
$Context.Action.TargetContainer = $newDestOU
}
I have tried to use this in a BR Before Creating a Group to set the OU based in the initiator, however I get the error:
Property 'TargetContainer' cannot be found on this object; make sure it exists and is settable.
Will this not work on a group? Ideally I want to set the OU before creation, rather than create it then move, is there a way?
Thanks,