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 (650 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 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 by barberk (290 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 (1.1k points)
0 votes
1 answer

My scheduled task currently: Checks for staff in a particular OU that do not have an O365 license Adds a license Resets their AD Password Moves them to an OU based off ... scheduled task moves them out of the OU that the business rule is looking at. Thanks

asked Apr 15 by russmerriman (450 points)
0 votes
1 answer

Dear support, I'm trying to automate network share creations via custom commands. They idea is to create share and groups with command A and schedule ... "ADS_SCOPE_BASE" $scopeItem.Exclude = $False $scopeItem.SetInfo() $task.ActivityScopeItems.Add($scopeItem)

asked Jan 27 by Dmytro.Rudyi (3.3k points)
0 votes
1 answer

Hi All, I'm trying to have a scheduled task email the helpdesk a list of machines from AD that have no description. I created a script and it runs the way I want it ... into just one email. Id like to run that in scheduled task if possible. Many thanks, Will

asked Nov 20, 2017 by will17 (1.2k points)
2,183 questions
1,948 answers
5,392 comments
5,257 users