0 votes

I have some custom command like "User Separation", which is sequenced with bunch of other actions, like disable, delete & modify etc. This custom command is published to web interface, so HR guy can login to the portal and run the command on a user account.

But if John Doe's last date is on Next Friday, 5PM, we want to give a option in the web portal thru which HR guy can pre-date/schedule the user separation custom command on John Doe's account for one time execution. And job executes on the particular date and time.

Is the possible?

by (460 points)

1 Answer

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


Yes, it is possible. First, you need to create a Home Page Action for specifying the separation date. The date will be passed via an Adaxes virtual property for date/time values, e.g. CustomAttributeDate1. Such attributes are not stored in AD, but can be used the same as any other attribute of AD objects.

Also, you will need to create a Shceduled Task that will run, say, daily and compare the date set for each user to the current date/time. If it is already the time to separate a user, it will run your Custom Command.

To do this:

i. Create Home Page Action for setting the separation date

For information on how to create a Home Page Action that allows modifying a user, see Configure Home Page Actions, section Modify Object. On Step 4 of the section, you will find instructions on how to modify the form used by the action. You need to remove everything. Then, you'll need to add a property that will be used to pass the separation date, for example, CustomAttributeDate1.

ii. Create Scheduled Task to perform user deprovisioning
To create a Scheduled Task that will execute your Custom Command for users on the dates specified for them:

  1. Create a new Scheduled Task.

  2. On the 3rd step of the Create Scheduled Task wizard, select User.

  3. On the 4th step, click Add Action and select the Execute a Custom Command action.

  4. In the Action parameters section, click Select and select the Custom Command you need.

  5. Click OK.

  6. Now, you also need to add an action to clear the custom attribute that is used to specify the deprovision date. This is needed to avoid processing the same user again. Right-click the action and select Add New Action.

  7. Select Update the User and click Add.

  8. In the Property to modify drop-down list, select Show all properties.

  9. Select the property that is used to specify the deprovision date, e.g. CustomAttributeDate1.

  10. Switch the radio button to Remove property.

  11. Click OK 2 times.

  12. Now, you need to specify when a user must be deprovisioned. First of all, the property that is used to specify the deprovision date must not be empty. Right-click the action you've just added and select Add Condition.

  13. Select the If <property> <relation> <value> condition type.

  14. In the Condition parameters section, specify If CustomAttributeDate1 is not empty:

    • where CustomAttributeDate1 is the property that is used to specify the deprovision date.
  15. Click OK.

  16. Also, the date when a user must be deprovisioned must be less than or equal to the current time. Right-click the action and select Add Condition again.

  17. Select the If <property> <relation> <value> condition type.

  18. In the Condition parameters section, specify If CustomAttributeDate1 is less then or equal.

    • where CustomAttributeDate1 is the property that is used to specify the deprovision date.
  19. Click the Edit button embedded in the Value field.

  20. Activate the Generate date tab.

  21. Select Current date/time.

  22. Click OK 2 times. You should receive something like this:

  23. Finish creation of the Scheduled task.

Also, to tell your users more about the meaning and the function of the field, you can change the name under which the property that you've chosen for the separation date appears in Adaxes. For details, see Customizing Display Names for AD Properties.


This works. I will fine my solution in next few days & will get back in case any issues. Only problem with this is I have to track usage of this Custom Date attribute against my scheduled tasks.



Actually, as mentioned in the very beginning of the instructions, CustomAttributeDate1 is just an example. There are 5 virtual properties that can store date and time, CustomAttributeDate1 to CustomAttributeDate5. If you are already using CustomAttributeDate1 for any purposes, you can use any of the remaining 4 instead.


Thanks, I saw those extra attributes. I have two follow up questions.

  1. When this CustomAttributeDate1 gets updated as per date and time selection, Is there an option to send out a confirmation mail to the initiator that this has been scheduled?

  2. As tasks are getting scheduled for later execution, they are loosing Initiator's details. In the Custom Task I have few Action Items which sends emails and create other service request tickets, departure audit logs in other systems on behalf of initiator (%adm-InitiatorEmail%). So if there is a way to capture who initiated the original schedule, I can use that attribute for my other work flow.


Hello Brajesh,

  1. Initiator is already performing this operation, what's the sense of making them confirm the action once more? Or do you want just an email notification as a reminder?

  2. No, because in case if an operation is performed by a Scheduled Task, the Scheduled Task acts as the initiator. As a workaround, you can store the Distinguished Name (DN) of the initiator in a certain attribute of the departing user, and then use the DN in your conditions. For this purpose you can use Adaxes virtual attributes that allow storing String values, e.g. CustomAttributeText1.

  1. Correct, for later schedules we usually provide a confirmation to the initiator saying this has been accepted & scheduled for this time and ready to go. So initiator use it for tracking & other business wide follow up/changes or re-schedule them if there is any changes in departure.

  2. That will be great. I can use that DN attribute to pull out original initiators email ID etc. & use it for my other alien systems workflow. Please help me with that process.


I am able to use your idea ;-).
I am using a business rule; if this Date1 attribute is changed, catch initiators email ID for immediate confirmation email & then update Txt1 attribute for later use.
Thank you!!


Hello Brajesh,

As far as we understand, you've already implemented this yourself. Do you need our further assistance with this request?


All solved. Thank you.

Related questions

0 votes
1 answer

On Approval Requests, in the web console, Initiator shows "N/A" instead of the custom command scheduled task. The admin console shows the custom command scheduled task though. Any way to fix that?

asked Jan 21, 2021 by mark.it.admin (2.1k points)
0 votes
0 answers

I am creating a new scheduled task and form. We would like to have the ability to schedule the reassignment of a staff member to a different location in the future. ... context, my manager won't necessarily know when he tries to move somebody. Thanks everybody

asked May 21, 2020 by jcalvert (60 points)
0 votes
1 answer

I have an ADP Sync scheduled task that modifies and creates users from a csv file. I also have reports that show new users created and management history for user ... ADP Sync scheduled task so that they only run after the ADP Sync task is complete?

asked Jan 7, 2020 by barberk (60 points)
0 votes
1 answer

Hello - I'm working on my companies off boarding process and need to run a Custom Command that turns off access to different systems and resources at the ... -9612-c7c982baa49f}" $user.ExecuteCustomCommand($commandID) # Save the Scheduled Task $task.SetInfo()

asked Jul 16, 2015 by jakesomething (190 points)
0 votes
1 answer

I have set up a web portal page to run a custom command, the problem is that the custom command is not run on a single user, it is more like a scheduled task. So I need ... can run the task on demand, not at a scheduled time. Thank you for all your help. Tony

asked May 21, 2014 by babbeaw (320 points)
2,807 questions
2,541 answers
64,590 users