Score:0

Windows 10 Run Task On Any Domain User Login and then Delete Task

gw flag

I have a scenario where I need a non-domain joined Windows 10 to reboot after it gets joined to a domain and there's a logon of a domain user - any domain user, not a specific one. I'd also need this reboot to happen only once after the initial logon on that user.

I've tried to create a scheduled task that runs when any domain user logs in and reboots the device but I can't seem to find a way of setting this domain user part up without the device already being domain joined? Is this even possible?

I'd also like for this to only happen once, so after the reboot (triggered by the logon on a domain user), I don't want the machine to reboot every time someone logs in. To try cover this off, I looked at Task Scheduler's 'Delete Task After' option but that doesn't look like it'd work either since the task will always be scheduled to run (when any domain user logs in).

Does anyone have any experience taking care of something like this? At this point, I'm pretty sure I'm trying to force a square peg into a round hole using Task Scheduler and that using something like PowerShell might be the better option.

Any ideas how I'd go about this?

Thanks in advance

Score:1
uz flag

Does it have to be a scheduled task? Group Policy can be configured for one-and-done type changes, and joining to a domain means that Group Policy will apply.

Taking that a step further, Group Policy can create Scheduled Tasks, too.

Score:0
ng flag

Use a Group Policy with a logon script, and write the script so that it only runs once (f.e. by checking and then setting a Registry key, or a file).

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.