0 votes

I am trying to send a $context.logmessage from a condition script in a Scheduled Task but I get nothing in the log. Is this not possible?

Morten A. Steien

by (300 points)

1 Answer

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

Hello Morten,

It is possible to use the $Context.LogMessage method in conditions of a Scheduled Task. However, the message output by the method will not be present in the execution log of any action executed by the Scheduled Task. To see the message in the logs, you need to enable logging of the Execute scheduled task operation which is disabled by default, run the task and then check corresponding log records in the General log (log records for the Execute scheduled task operation are not displayed in the Activity History).

0

Thank you! That fixed my problem.

Related questions

0 votes
1 answer

If I have a scheduled task powershell script that's targeting an OU of users and in that script I were to call $context.cancel in the case of an error happening for a single ... it cancel the entire scheduled tasks and it won't run for other users in that OU?

asked Oct 18 by wrichardson (20 points)
0 votes
1 answer

seting up a scheduled task to move users to thier correct OU. For some we can do this based on employee type and direct to a specific OU. For most of our users we will have to script this to move to the manager's OU.

asked Apr 12, 2023 by mightycabal (1.0k 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, 2022 by Simone.Vailati (430 points)
+2 votes
1 answer

Most of my PowerShell code is written in VS Code and then copied/pasted to the Adaxes script editor. However, if you use $Context in your scripts, you can't execute them ... = [Context]::new() $Context.LogMessage("foo", "information") Output: [Information] foo

asked Nov 3, 2023 by ngb (290 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)
3,541 questions
3,232 answers
8,225 comments
547,800 users