Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

windows run powershell script from task scheduler

$Trigger= New-ScheduledTaskTrigger -At 10:00am –Daily # Specify the trigger settings
$User= "NT AUTHORITYSYSTEM" # Specify the account to run the script
$Action= New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "C:PSStartupScript.ps1" # Specify what program to run and with its parameters
Register-ScheduledTask -TaskName "MonitorGroupMembership" -Trigger $Trigger -User $User -Action $Action -RunLevel Highest –Force # Specify the name of the task
Comment

powershell task scheduler

when using PS modules, create a task that runs a .bat file that calls PS
Comment

PREVIOUS NEXT
Code Example
Shell :: how to install global package golang 
Shell :: redirect to file 2&1 
Shell :: get the latest from remote git 
Shell :: linux add prefix to all files 
Shell :: change git repository commmand 
Shell :: clone branch git 
Shell :: how to close port in linux 
Shell :: mac docker-compose 
Shell :: git copy folder from another branch 
Shell :: how to set two wallpaper in ubuntu 
Shell :: echo new line in a file bash 
Shell :: remove all gems installed 
Shell :: grep wildcard 
Shell :: git config --list 
Shell :: how to remove bin folder from git 
Shell :: how to run pkg file on mac terminal 
Shell :: exclude certain extension from zip linux 
Shell :: curl save file 
Shell :: command to select a word in vim 
Shell :: how to start elasticsearch correctly 
Shell :: how to get visual studio code on a raspberry pi 4 
Shell :: netspeed ubuntu 20.04 
Shell :: yum install gcc 
Shell :: github clone to local folder 
Shell :: git check differences between two projects 
Shell :: ppsspp debian 10 
Shell :: global yarn install 
Shell :: expo app size 
Shell :: remove directory linux 
Shell :: how to install powershell 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =