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 (294k 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, 2022 by jbahou (20 points)
0 votes
1 answer

Hello, I'm trying to create a business rule that will update a user account expiry date when that user logs in for the first time. I'm new to Adaxes, so I don't have a ... updated by a user's action, such as "Last Logon". Is it possible to make this work?

asked Mar 6 by sjjb2024 (60 points)
0 votes
1 answer

I want to add a custom column in a report that displays members of a group that shows the age of the user account in days. Is that possible?

asked Oct 23 by msheppard (660 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)
3,589 questions
3,278 answers
8,303 comments
548,118 users