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 (960 points)
0 votes
1 answer

Is it possible to create a business unit and have it auto populate with group owners in a specific OU. I've tried a few scripts to get propertie adm-managedbylist but none have worked so far.

asked 6 days ago by C27 (20 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)
3,549 questions
3,240 answers
8,232 comments
547,814 users