Support Center

(Windows) Commands Tab Policy - Logon Triggered Tasks

Summary

Using the Commands Tab, many administrative users will deploy scripts and commands to further their ability for systems management using JumpCloud.  In working with a varied audience of users and environments, we have collaborated to create some "Policy" commands for purposes ranging from security to software management.

The commands listed in this article are specific to triggering tasks upon login.

Considerations

  • Requires Windows 8, Windows Server 2012 or newer.
  • ​Scheduled tasks created in this manner will run as the same user that created them.
When utilizing Windows, you have the ability to decide if you would like to run the command execution via either PowerShell or CMD.  Some commands will require that one or the other be specified.  

With the Logon Triggered Task example, you must execute it using Windows Powershell.  


Execution

In the below example a scheduled task is created called "Test" which will execute "test-script.ps1" upon next login. 

$action = New-ScheduledTaskAction -Execute C:\test-script.ps1
$trigger = New-ScheduledTaskTrigger -AtLogOn
Register-ScheduledTask -Action$action -Trigger $trigger -TaskName "Test" -Description "Testing Scheduled Task API via PowerShell"


This can be viewed in the Task Scheduler snap-in alongside all other scheduled tasks.

Get-ScheduledTask
 

Last Updated: May 01, 2017 05:02PM MDT

Related Articles
desk-forwarding@jumpcloud.com
http://assets0.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete