0 votes

I have an account that I am using as the "run as" account to run PowerShell scripts for several different custom commands. I would like to be able to update the saved password for this account in each custom command through a script that I can run when it's time to change the account password. I think this is possible when creating a new custom command using the RunAs() function for IAdmRunScriptAction, but I haven't found a way to use this to update an existing custom command.

Is it possible to write a script that updates the credentials used to run a script in an existing custom command?

by (320 points)
0

Hello,

Yes, it is possible. For us to write the script please, specify the following:

  • Does it meet your needs if the script to update the passwords will be executed in a custom command and the new password itself will be entered using a parameter?
  • Should the script just update the password in the Run as section for all the Run a program or PowerShell script actions in all the specified custom commands? If not, please, describe the desired behavior in all the possible details with live examples.
0

We will be running the script from another application which will automatically rotate the password for the AD account, so I would like for the script to be standalone if possible. If not possible, running it within a custom command is fine since we can use the REST API to call the custom command from the other application.

Yes, ideally we would define a list of custom commands (which could be hard coded into the script rather than a parameter) and then the script would update the password for all the Run a program or PowerShell script actions within each command.

1 Answer

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

Hello,

Thank you for specifying. Please, have a look at the following script from our repository: https://www.adaxes.com/script-repository/update-script-credentials-in-custom-commands-s646.htm.

0

This is perfect! Thanks so much for your help!

Related questions

0 votes
1 answer

Receive "Index operation failed; the array index evaluated to null. Stack trace: at <ScriptBlock>, <No file>: line 104>" and "Index operation failed; the ... $GroupName, $GroupDN." } } #foreach write-output "" Write-Output "" Stop-Transcript

asked Apr 14 by jbahou (20 points)
0 votes
1 answer

Currently, when I disable a user account in Adaxes, the group memberships of the user remain intact. I'd like to automate the removal of group memberships such as distribution ... a list of groups/DL that the user was previously in and removed from. Thanks!

asked Nov 3, 2021 by jayden.ang (20 points)
0 votes
0 answers

Before Deactivation of an Account on the Webinterface our Help Desk need to change the AD User Description manually. Is it possible to force a manual change before deactivation ?

asked Feb 7, 2020 by lv01 (20 points)
0 votes
1 answer

Dear Support Admin Hi, I hope you are in good health. I have a problem regarding the office 365 license my problem is: I have a case where if HR adds a new AD user, ... Is that possible to do? for example using a script or display it in another form? Thank you

asked Mar 4 by systech (100 points)
0 votes
1 answer

Is there a way to have a Scheduled Task with 4 different condition? I want to create a scheduled task start every Monday and the condition see: The next Saturday of the week ... of the week is the fifth of the month then no action Thanks in advance, Simone

asked Jan 18 by Simone.Vailati (270 points)
2,780 questions
2,513 answers
6,578 comments
27,297 users