0 votes

A little bit of context:

There are 3 departments that share 1 Active Directory. Now each department has its own OU. I would like to have an email sent when a user is removed from 1 specific OU.

Do you know if this is possible without Powershell? If not, is there a pre-existing script for this?

by (200 points)

1 Answer

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

Hello,

That is not something that can be done just using a single script. You will need two business rules and a script. The script will be executed in a business rule triggering Before moving a user and set a certain property value (e.g. CustomAttributeBoolean1 to true). The rule will only be assigned over the users located in the required OU. The second business rule will trigger After moving a user. It will check the property set by the first rule and send an email notification if necessary. Finally, you should have something like the following:

Business rule triggering Before moving a user image.png

$Context.TargetObject.Put("adm-CustomAttributeBoolean1", $True)
$Context.TargetObject.SetInfo()

Business rule triggering After moving a user image.png

Related questions

0 votes
1 answer

Is it possible to have a business rule of the form: IF (company = "Company1") then set City = "New York" set Manager = "New York Manager" If (state = "CO") then set telephone "303" else if (state = "NY") set telephone "202" else clear telephone end if end if

asked Aug 23 by Jiver (20 points)
0 votes
1 answer

We have a process that when a new user is created they are emailed their username and apssword. If the user is in an Admin Group they are then sent an email with some PDFs ... you can send emails, but am unable to see where it could attach files to the email?

asked Sep 3, 2020 by dknapp (100 points)
0 votes
0 answers

I am trying to find a way to create Groups based off an OU and a list of options (check boxes) within the portal For example: Select the Target OU to add groups ... 3 - Remote Administrators Option 3 - Remote Developers Option 4 - Readers Option 4 - Writers

asked Sep 11, 2020 by dknapp (100 points)
0 votes
1 answer

My security team is looking to do a security review and would like the vendor to fill out a questionnaire.

asked Aug 25, 2023 by LarrySargent (20 points)
0 votes
1 answer

Automation of user creation based on ServiceNow ticket creation.

asked Jan 24, 2022 by tdetmer (20 points)
3,569 questions
3,259 answers
8,275 comments
547,952 users