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
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).
Thank you! That fixed my problem.
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?
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.
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
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
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?