Avatar of String :-)
String :-)Flag for Australia

asked on 

Powershell - Register Scheduled Task - How to add a second trigger

I use this script to register a scheduled Task

$Trigger= New-ScheduledTaskTrigger -At 7:01am -Daily
$User= "NT AUTHORITY\SYSTEM"
$Action= New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-File D:\scripts\Get_Stuff_DO_Stuff.ps1"
Register-ScheduledTask -TaskName "TASKXYZ" -Trigger $Trigger -User $User -Action $Action -RunLevel Limited –Force

The business require a second trigger added at 7:01pm, therefore my question how to add a second trigger to this task. Many thanks String
Powershell

Avatar of undefined
Last Comment
String :-)
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of String :-)
String :-)
Flag of Australia image

ASKER

Bingo. Works a treat (and great learning exercise).
Thanks a bunch oBdA
Powershell
Powershell

Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.

27K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo