0 votes

I have a custom command that runs a powershell script that works just fine but it takes a long time to run. When I run it on the server as just the powershell script it works, but takes about 6.5 minutes to run. When I run it through the web interface it always seems to timeout and I eventually get an error page. I'm assuming the error page is because the script takes so long to run that the browser eventually times out. Is there anyway to prevent this from happening?

Thanks!

by (520 points)

1 Answer

0 votes
by (18.0k points)

Hello,

You can configure your Custom Command to execute the PowerShell script asynchronously:

  1. Right-click your 'Run script' action and select Edit Action in the context menu.
  2. Enable the Execute asynchronously option for the action.
  3. Save the changes.
0

That worked quite well. Thank you.

0

Have you done exactly the same as given in screen shots ? Does it working now ?

0

Hello Harry,

Have you encountered any issues when implementing the above solution? Did you get any errors?

If you have some questions, issues or errors, please describe them in more detail.

0

I also have a script that takes a while to run. I have tried running it asynchronously but Adaxes still times out after 10 minutes and then the script never completes. Is there any way to increase the time that Adaxes waits for the process to finish?

0

Hello Stuart,

The thing is currently in Adaxes we have a limitation of 10 minutes, during which a PowerShell script should complete. If a script fails to complete within 10 minutes, the operation is cancelled. Currently there is no setting or configuration entry that you can use to increase the time limit.

It is quite strange that a PowerShell script cannot complete in 10 minutes. 10 minutes in more than enough for a PowerShell to complete. Probably, the best way to resolve this issue would be to optimize the script. Can you describe what the script does or send the script to our support email (adaxes@softerra.com)?

Related questions

0 votes
2 answers

I've had a couple custom commands configured since 6/2023 and they've been working just fine up until recently (sometime within the past few weeks or so). Here's a general ... something obvious here. But I can't make sense of why this is suddenly an issue.

asked Mar 20 by msinger (110 points)
0 votes
1 answer

Hi team, I have a follow up to this question https://www.adaxes.com/questions/14234/business-after-adding-members-powershell-script-executed Let me explain my setup A rule- ... area% failed due to the following exception: $($_.Exception.Message)", "Error") }

asked Feb 13 by wintec01 (1.1k points)
0 votes
1 answer

Hi, When we add custom command action in UI, when a user selects 1 or more users for that custom commands, is there a way to integrate those selected users as input value into that custom command script and take action on those users.

asked Feb 5 by Renugopal (120 points)
0 votes
1 answer

To the left of the user object there are several custom commands showing. I don't want our service desk to see them. Why are they showing? How do I remove them. Must be something simple. They only see these when looking at a user Object.

asked Jan 17 by mightycabal (1.0k points)
0 votes
1 answer

I need to add many check-box list items to a Custom Command, I think the best way to do this is via PowerShell rather than through the UI. What's ... Softerra.Adaxes.Interop.Adsi.Parameters.IAdmParameterCheck[]]$ItemsList # Also doesn't work $command.SetInfo()

asked Jan 4 by Viajaz (210 points)
3,346 questions
3,047 answers
7,782 comments
544,982 users