0 votes

Having a strange issue, when executing a powershell command in adaxes as a business rule, the first line, no matter what is there comes up as invalid. Originally my script started with a commented line, but I've tried everything and universally the first line is flagged as invalid

image.png image.png

by (290 points)
0

On update of a user.

0

Hello,

For troubleshooting purposes, please, specify how exactly you add scripts to the Run a program or PowerShell script action?

Also, please, post here or send us (support@adaxes.com) a screenshot of the Multi-server environment dialog. The dialog displays how many Adaxes services you have and what their versions are. For information on how to view it, see https://www.adaxes.com/help/MultiServerEnvironment.

0

Here is how the script is executed: image.png

Here is the MultiServer, we only utilize 1 server: image.png

0

Hello,

Here is how the script is executed

Sorry for the confusion, but the question is not about how the script is executed. We need to know, how you add it to the action. For example, you can directly write the script in the editor. Alternatively, the script can be added from a file that you open through the editor by browsing your file system.

Here is the MultiServer, we only utilize 1 server

Thank you for the provided screenshot.

0

I've copy/pasted it and opened it via a file saved in Powershell ISE, both ways had the same outcome.

1 Answer

0 votes
by (292k points)

Hello,

Thank you for clarifying. To resolve the issue, please, do the following:

  1. Copy the script from this thread (you provided it earlier) to a text editor, e.g. Notepad.
  2. Remove the first two lines (one is empty and the other imports the Adaxes module).
  3. Launch Adaxes Administration console.
  4. Navigate to the business rule in question and right-click Run PowerShell script ‘Outbound-Updates-to-Oracle’ for the user.
  5. In the context menu, click Delete Action. image.png
  6. In the dialog that opens, click Yes.
  7. Right-click Do nothing and then click Add Action.
  8. Select Run a program or PowerShell script.
  9. Specify a script description and click Edit. image.png
  10. Copy/paste the script from the text editor (make sure not to save it in any way).
  11. Click OK twice and save the changes.

The execution should work fine in this case. The best approach is to directly write scripts in Adaxes script editor to avoid any issues with formatting added by other applications.

Related questions

0 votes
1 answer

Hi, I have a lot of custom PowerShell scripts running and I am wondering, if its possible somehow to get the name of the PS Script the line of the execution of a code ... occurs and send directly the action, maybe path in Adaxes and line number of the script.

asked Oct 7 by wintec01 (1.5k points)
0 votes
1 answer

Trying to set the primary proxy when doing a name change on an email address.

asked Jul 13, 2023 by mightycabal (1.0k points)
0 votes
1 answer

I thought I would share this. We are new to Adaxes but really finding it a great tool to host some powershell scripts and make them accessible to others in the team without ... --------- If there are better ways to do this I am definitely interested.

asked Nov 29, 2018 by jbadry (430 points)
0 votes
1 answer

Hi, I have this Script to check if a condition is met # The condition is met if $Context.ConditionIsMet is set to $True. $Context.ConditionIsMet = $False $inputString = " ... or issue with this match function using in a "if script returns true" condition?

asked Oct 31 by wintec01 (1.5k points)
0 votes
1 answer

For creating a computer object, we want to check if the entered CN is already used in our AD. And for that we want to use a powershell script. An other dot ... powershell script should be start before creating the computer object, right? Thanks for your help.

asked Jun 4 by KEME (80 points)
3,569 questions
3,259 answers
8,275 comments
547,938 users