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 user. Does that cancel the script for just that user or will it cancel the entire scheduled tasks and it won't run for other users in that OU?

by (20 points)

1 Answer

by (306k points)
0 votes

Hello,

It will only cancel execution of the scheduled task for the current user and proceed with other accounts from the Activity Scope.

Related questions

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

asked Jul 20, 2020 by Morten A. Steien (300 points)
0 votes
1 answer

Hello, We have a task which checks every hour if jobs have been added to a list (CSV-File) and if so will start provisioning tasks including Microsoft Teams. If ... job has completed or is still running to prevent duplicate runs. Is this somehow possible?

asked 1 day ago by andrep (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.2k points)
0 votes
1 answer

My scheduled task works like this (these are my action sets) Condition(s): Account is expired and home drive exists Action The user's home directory gets archived Condition(s): ... set? I do not want to split the scheduled task into two! Thanks in avance!

asked Apr 7, 2022 by lehnen (20 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 (500 points)
0 votes
1 answer