Hi Everyone,
I am looking for some help in scripting the Monthly trigger for Clustered Scheduled task, this has to be configured through Powershell and GUI does not work. For Clustered Scheduled task it has only daily and Weekly but not direct Monthly trigger, need to have a workaround to have this done.
Below is the 'Powershell commands' I am trying to schedule the task to run 1st of every month
$Trigger = New-ScheduledTaskTrigger -At 05:00AM -daliy
if ((Get-Date).day -eq 01) { $action= New-ScheduledTaskAction -Execute "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -Argument "E:\SCRIPTS\TaskScheduler\Test123.ps1" }
Register-ClusteredScheduledTask –Cluster "Taskserver01.contoso.com" –TaskType AnyNode –Action $action –Trigger $trigger –TaskName Test123