0 votes

Hello

Is it possible to reference a powershell script placed in a folder somewhere on the Adaxes server, instead of embedding them in each BR and CC ?

I'm planning to install a powershell GUI product, for easy debugging.

- Thanks

by (2.6k points)

1 Answer

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

Hello,

Yes, there is. To do this:

  1. Add the Run a program or PowerShell script action to your rule, command or task.
  2. Specify the full path to your external script in the Script field, for example: C:\Scripts\MyScript.ps1.

Note however that if you are going to use your product for showing GUI from scripts executed by Business Rules, Custom Commands or Scheduled Tasks, you won't be able to see that GUI. Scripts run as a part of rules, commands or tasks are executed by Adaxes service. In Windows, GUI displayed by services is never shown to users.

As a workaround, for debugging purposes, you can use the $Context.LogMessage method that updates the Execution Log of an operation. The first parameter of the method is the text of the message you want to add; the second parameter is the type of the message. The second parameter can take the following values: "Information", "Warning", and "Error".

Example:

$Context.LogMessage("My message", "Information")

Related questions

0 votes
1 answer

Hello, We have a problem with the way Adaxes detects % as variables in all PowerShell scripts. We are configuring a HTML email template for all out going emails from the system ... this is a start of a variable. Is there anyway around this? Regards, ice-dog

asked Feb 22, 2019 by ice-dog (170 points)
0 votes
1 answer

Hello, I have few business rules for AD account rename to validate input data and make sure username selected is unique in AD, but sometimes it fails with very non-explaining error " ... a "Before updating a User" rule BR14 - is a "Before renaming a User" rule

asked May 14, 2018 by DLe (760 points)
0 votes
1 answer

Hello, I am using a custom task to run PowerShell scripts that migrate users to Office 365. After the initial migration is complete, I'm running a second script ... .Actions.RunScriptAction.Execute(ICommand command) --- End of inner exception stack trace ---

asked Feb 19, 2015 by DFassett (710 points)
0 votes
1 answer

I need some assistance combining 1: https://www.adaxes.com/questions/9428/daily-scheduled-task-to-disable-inactive-users With 2: https://www.adaxes.com/questions/1509/inactive-users For ... a custom paramater for $days ? For 2: "less or equal" isn't an option.

asked Dec 30, 2024 by apruitt (140 points)
0 votes
1 answer

I'd like to log specific details from my scripts but would like to integrate it with Adaxes if possible.

asked Jun 5, 2024 by ZoomGhost (280 points)
3,606 questions
3,293 answers
8,343 comments
548,458 users