Skip to main content

New-LXCAScheduleRule

This cmdlet creates a rule for a recurring schedule object that is to be created using New-LXCAScheduleObj cmdlet.

Note
You cannot pipe objects to this cmdlet.

Syntax

New-LXCAScheduleRule [-Connection LXCAConnection] 
-StartTimeStamp DateTime
-EndDate Nullable[DateTime]
-Days String[]
[CommonParameter]

New-LXCAScheduleRule [-Connection LXCAConnection]
-StartTimeStamp DateTime
-EndAfter String
-Days String[]
[CommonParameter]

New-LXCAScheduleRule [-Connection LXCAConnection]
-StartTimeStamp DateTime
-EndDate Nullable[DateTime]
[-RecurEvery Int32]
-DayOfTheWeek String
[CommonParameter]

New-LXCAScheduleRule [-Connection LXCAConnection]
-StartTimeStamp DateTime
-EndAfter String
[-RecurEvery Int32]
-DayOfTheWeek String
[CommonParameter]

New-LXCAScheduleRule [-Connection LXCAConnection]
-StartTimeStamp DateTime
-EndDate Nullable[DateTime]]
[-RecurEvery Int32]
-DayOfTheWeek String
-WeekOfTheMonth String
[CommonParameter]

New-LXCAScheduleRule [-Connection LXCAConnection]
-StartTimeStamp DateTime
-EndAfter String
[-RecurEvery Int32]
-DayOfTheWeek String
-WeekOfTheMonth String
[CommonParameter]

New-LXCAScheduleRule [-Connection LXCAConnection]
-StartTimeStamp DateTime
-EndDate Nullable[DateTime]]
[-RecurEvery Int32]
-DayOfTheWeek String
-WeekOfTheMonth String
-MonthOfTheYear String
[CommonParameter]

New-LXCAScheduleRule [-Connection LXCAConnection]
-StartTimeStamp DateTime
-EndAfter String
[-RecurEvery Int32]
-DayOfTheWeek String
-WeekOfTheMonth String
-MonthOfTheYear String
[CommonParameter]

Parameters

-Connection LXCAConnection
Specifies the connection to the Lenovo XClarity Administrator server. If no connection is specified, the result from the last Connect-LXCA cmdlet is used.
-StartTimeStamp DateTime
Specifies the date and time when the schedule is to be triggered for the first time.
-EndDate Nullable[DateTime]
Specifies the date when the schedule is to end.

If set to $null, the schedule is permanently Active until the schedule is manually ended.

-Days String[]
Specifies one or more days when scheduled job runs. This can be one of the following values
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday
-EndAfter String
Specifies the number of times that the scheduled job runs before the schedule ends.
-RecurEvery Int32
Specifies the number of weeks, months, or years that the scheduled job runs.
-DayOfTheWeek String
Specifies the day of the week when the scheduled job runs. This can be one of the following value.
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday
-WeekOfTheMonth String
Specifies the week of the month when the scheduled job runs. This can be one of the following values.
  • FirstWeek
  • SecondWeek
  • ThirdWeek
  • ForthWeek
  • FifthWeek
-MonthOfTheYear String
Specifies the month of the year when the scheduled job runs. This can be one of the following values.
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
CommonParameters
This cmdlet supports the following common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable, -OutBuffer, -PipelineVariable, -OutVariable. For detailed information about each common parameter, see the Microsoft PowerShell Common Parameters webpage.

Results

Examples

The following example creates a daily rule that runs on Mondays and Fridays for 22 occurrences.
$cred = Get-Credential
Connect-LXCA -Host "192.0.2.0" -Credential $Cred -SkipCertificateCheck

$dailyEndAfter = New-LXCAScheduleRule -Days Monday,Friday `
-EndAfter 22 `
-StartTimeStamp "2022-2-22 02:00:00"

Disconnect-LXCA
The following example creates a daily rule that is active until the schedule is manually ended. The -EndDate property is assigned with $null value.
$cred = Get-Credential
Connect-LXCA -Host "192.0.2.0" -Credential $Cred -SkipCertificateCheck

$dailyNoEnd = New-LXCAScheduleRule -Days Friday `
-StartTimeStamp "2022-2-22 02:00:00" `
-EndDate $null

Disconnect-LXCA
The following example creates a monthly rule that occurs every three months, on the Wednesday of third week of that month, until the -EndDate is passed.
$cred = Get-Credential
Connect-LXCA -Host "192.0.2.0" -Credential $Cred -SkipCertificateCheck

$monthly = New-LXCAScheduleRule -DayOfTheWeek Wednesday `
-WeekOfTheMonth ThirdWeek `
-RecurEvery 3 `
-StartTimeStamp "2022-2-22 02:00:00" `
-EndDate "2024-2-22 02:00:00"

Disconnect-LXCA