0 votes

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. We are a school district and come September there are potentially hundreds of moves. I have been following this page; https://www.adaxes.com/questions/1113/schedule-a-user-to-be-added-to-a-group-via-web-interface?show=1113#q1113

But it appears to be outdated in for 2019.2 but I have been able to get the form created, with 2 fields, CustomAttributeText4 and CustomAttributeDate1.

CustomAttributeText4 is the new location from a selection of locations and CustomAttributeDate1 will be used to determine when to make the move.

I also created the custom task that runs daily at 8am. The task is laid out like this...

If the 'CustomAttributeText4' property is not empty AND
the 'CustomAttributeDate1' property equals '%datetime%' AND
the 'CustomAttributeText4' property equals 'Location A' then
Run PowerShell script 'Remove user from all location groups' for the user
Add the user to the 'All Location A Staff (mydomain.com\SD\Elementary Schools\LocationA)' group
Modify the user: clear CustomAttributeText4

Else if the 'CustomAttributeText4' property is not empty AND
the 'CustomAttributeText4' property equals 'Location B' then
Run PowerShell script 'Remove user from all location groups' for the user
Add the user to the 'All Location B Staff (mydomain.com\SD\Elementary Schools\LocationB)' group
Modify the user: clear CustomAttributeText4

<br> <br> While I have the scheduled task created, when I go through the form and pick the user, set the location (CustomAttributeText4) and pick the date (CustomAttributeDate1) one of my business rules automatically fires because it thinks another field has changed which I have a trigger on. The fields being used are unique so I am not sure why any thing entered in this form will trigger a business rule.

Any help would be appreciated, maybe I am misunderstanding the Custom Forms and how they work.

Also, how do you change the display text on custom fields?  While I know what CustomAttributeDate1 and CustomAttributeText4 are in this context, my manager won't necessarily know when he tries to move somebody.

Thanks everybody

by (60 points)
0

Hello,

I also created the custom task that runs daily at 8am. The task is laid out like this

The task will only be able to execute the actions in the Else If block because the condition the 'CustomAttributeDate1' property equals '%datetime%' can never be met. To compare dates you need to use the following script from our repository: https://www.adaxes.com/script-repository/check-whether-date-in-object-property-is-today-s528.htm. For your case, you will need to replace this line in the script

$Context.ConditionIsMet = $compareDate.Date -eq $currentDate.Date

with the following one:

$Context.ConditionIsMet = $compareDate.Date -ne $currentDate.Date

Also, there is no need to check CustomAttributeText4 for being empty as you have the equality condition for the attribute. Finally, the Scheduled Task will look as follows: image.png

The fields being used are unique so I am not sure why any thing entered in this form will trigger a business rule.

Could you, please, post here or send us (support[at]adaxes.com) a screenshot of the Business Rule?

Also, how do you change the display text on custom fields?

Have a look at the following help article: https://www.adaxes.com/help/?HowDoI.ManageActiveDirectory.EditFriendlyNames.html.

Please log in or register to answer this question.

Related questions

0 votes
1 answer

I have a PowerShell Script (being run in a Custom Command) that creates a Scheduled Task that runs another Custom Command but I want the resulting Scheduled ... Exclude = $False $scopeItem.SetInfo() $task.ActivityScopeItems.Add($scopeItem) $task.SetInfo() }

asked Apr 1, 2021 by Staj (350 points)
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.3k 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

Hello! how do i manage do get adaxes to remove all groups from the user after one month? We have a Business Rule where you can add an end of Date when the Account ... value field the powershell script works but not with the +1 Month. Thanks for your help!

asked Jun 14, 2023 by eww ag (140 points)
3,326 questions
3,026 answers
7,727 comments
544,678 users