I have to schedule password reset process that resets password for a application whose users expires every 30 days … so on 30th day the process should execute and reset password before expiry .
One more thing is , this process should run when no other processes are running to avoid clash … so it should ran on Saturday 8 AM .
Can someone please help in how to schedule this trigger ?
@Ragavi_Rajasekar one side you are saying it should run on the 30th days before the password expires, and on the other side you are saying it should run on Saturday what if the Saturday is not there on the 30th day?
You can consider one logic as below.
Set an asset value with the ResetDate and in the code build a logic that compare the ResetDate value with today’s Date and if the count is >=29 then go for the reset.
And this process you can schedule to run whenever is suitable as per the robots availability.
If Now >= lastReset.AddDays(30) Then
’ Reset password logic here
’ After resetting, update the asset:
SetAsset(“LastResetDate”, Now.ToString(“yyyy-MM-dd”))
Else
’ Not yet 30 days - exit
End If
This logic will work even if the month has 31 days, 30 days , 29 days (Leap year)
Follow the below steps for your process,
lets assume from today password will expire in 30 days,
create asset with today date.
in your process get this asset value.
get the difference of asset date value and current date value in days
add a condition check that difference is greater than 30
If it is greater than 30, in then section you can use your update password.
Update that reset date into date asset
If you are using on folder that running in one machine, even that job is running then it will went to pending once that job completes then it will start the execution.
if you are using multiple machines then you need to add one more condition that is there any jobs are running or not, if yes then send the stop request using orchestrator api.
Above process you can add in main flow or create with new process and add trigger that daily needs to run at 8AM
To make sure the expectations are met, you could consider resetting the passwords prior to the exact day that it expires.
Is it possible to do if after lets say 20 days? Or would that mess up something else?
If the reset is acceptable based on a shorter time span, then you should simply be able to make an ordinary timed trigger, based on your requirements (every Saturday @ 8 AM).
You could utilize queues or an Excel file to keep track of which accounts needs a reset.