0 votes

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,

by (390 points)

1 Answer

0 votes
by (216k points)

Hello,

No, it is impossible to replace the OU where a new group will be created with the help of a script. We suggest that you move newly created groups after they are created with the help of a Business Rule. For examples on how to accomplish this task, take a look at the following tutorials:

Related questions

0 votes
1 answer

Hello dear ADAXES community, what i wanted to do is, to have a custom report which does the following: get every group in a specific OU (the OU comes from an adaxes custom ... Add($Group.name) } } is this possible in such a way? thank you for your help

asked Sep 23, 2020 by m_st (200 points)
0 votes
1 answer

Is it possible to for security groups that are nested under an OU to inherit that OU's 'Managed By' value? I'd like to grant the OU Owner rights to the security groups ... option is to manually edit each group one by one. Is there a script that automates this?

asked Mar 26, 2020 by sirslimjim (480 points)
0 votes
1 answer

Hi, we need to create some form (or custom command?) so managers of distribution groups can add/remove/change alias address. Primary and secondary. Distribution groups are ... contains list of current aliases with possibility to edit them... Thank you Sebela

asked Nov 18, 2019 by KIT (910 points)
0 votes
1 answer

Hello, We would like to implement a form / extend one where a user (eventually created before) is made member of a security group defining his/her role, and ... guarantee the membership to a single role? Apologize if the question seems convoluted. Thanks!

asked Jun 6, 2023 by IT Division (20 points)
0 votes
1 answer

I have 18 domains managed by Adaxes and have noticed that Admin (full access) t all objects acts normally, but for piecemeal scopes like Service Desk that scopes to individual ... role (including 16 denies) and expect it to grow as we add more domains.

asked Sep 20, 2022 by DA-symplr (80 points)
3,326 questions
3,026 answers
7,727 comments
544,681 users