0 votes

Hello

I need to do some checks (using a script) before moving a user to another OU.


I need to put the "new location" in a variable. How do I do that ?

- Thanks

by (2.6k points)

1 Answer

0 votes
by (216k points)
selected by
Best answer

Hello,

The following script will do the job. The Distinguished Name (DN) of the new container where the user will be moved will be available in $containerDN.

$container = $Context.Action.TargetContainer
if ($container)
{
    $containerDN = $container.Get("distinguishedName")
}
else
{
    $containerDN = $Context.Action.TargetContainerDnTemplate
}

Related questions

0 votes
1 answer

Example: If a user has a ' in theirname: Fred J O'neal. Normally the username is set as %lastname:lower,4%%firstname:lower,3%%initials:lower% Problem is o'nefrej would be the result. ... name", "Information") $username = #this is what I'm not sure how to do?

asked Dec 6, 2022 by mightycabal (1.0k points)
0 votes
1 answer

I understood that following this logic, the link directs me to the user's viewing page. %adm-WebInterfaceUrl%ViewObject.aspx?guid= ... success %adm-WebInterfaceUrl%EditObject.aspx?guid=%objectGUID% %adm-WebInterfaceUrl%ModifyObject.aspx?guid=%objectGUID%

asked Nov 15, 2022 by Simone.Vailati (430 points)
0 votes
1 answer

Thanks for the info. I'm now grabbing the %adm-ManagerUserName% value, but need to remove the final 21 characters of it so it contains only their username and not our ... this in the PowerShell Script Editor for my business rule, I get the following error:

asked Mar 11, 2021 by mkvidera (60 points)
0 votes
1 answer

We are new ADAXES customers and we would like to know if DNS is integration in the tool is planned in the future releases of the product ?

asked Dec 18, 2020 by fdemartino (20 points)
0 votes
1 answer

I am evaluating Adaxes. I noticed that the web interface does not allow modification of the External Email Address (ms-Exch-Target-Address). What would someone do if they needed to change the Target Address?

asked Aug 6, 2020 by ComputerHabit (790 points)
3,589 questions
3,278 answers
8,303 comments
548,153 users