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 (170 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 (211k 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

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 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
0 answers

I have created a Custom action to create some "standard" sub OUs to a particular type of OU in our AD. I wanted to create a script to look in the OU you are executing ... 'Users') -or ($child.Name -eq 'Computer Systems')) {$Context.ConditionIsMet = $False } }

asked Aug 31, 2016 by ggallaway (300 points)
0 votes
1 answer

I have a feild called Decommissioned Date and I can not figure out how to run a scheduled task the day after that date. So If an account got decommissioned today I want the task to run tomorrow.

asked Jan 9, 2020 by hgletifer (1.2k points)
0 votes
0 answers

Hello! I've run into this problem before with the windows task scheduler. It looks like there's no way in the interface to target a specific day in the month aside from ... of the month and output $True so I can use it to trigger an email notification?

asked Nov 10, 2015 by drew.tittle (810 points)
2,607 questions
2,344 answers
6,228 comments
861,145 users