New-CMSchedule
SYNOPSIS
Skapa en Konfigurationshanteraren schematoken.
SYNTAX
RecurrenceNone (standard)
New-CMSchedule [-IsUtc] [-Nonrecurring] [-ScheduleString] [-Start <DateTime>] [-DisableWildcardHandling]
[-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]
RecurrenceMonthlyByDate
New-CMSchedule -DayOfMonth <Int32> [-IsUtc] [-RecurCount <Int32>] [-ScheduleString] [-Start <DateTime>]
[-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]
RecurrenceMonthlyByDateWithDuration
New-CMSchedule -DayOfMonth <Int32> -DurationCount <Int32> -DurationInterval <ScheduleInterval> [-IsUtc]
[-RecurCount <Int32>] [-ScheduleString] [-Start <DateTime>] [-DisableWildcardHandling]
[-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]
RecurrenceMonthlyByDateWithEnd
New-CMSchedule -DayOfMonth <Int32> -End <DateTime> [-IsUtc] [-RecurCount <Int32>] [-ScheduleString]
[-Start <DateTime>] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]
[<CommonParameters>]
RecurrenceWeekly
New-CMSchedule -DayOfWeek <DayOfWeek> [-IsUtc] [-RecurCount <Int32>] [-ScheduleString] [-Start <DateTime>]
[-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]
RecurrenceWeeklyWithDuration
New-CMSchedule -DayOfWeek <DayOfWeek> -DurationCount <Int32> -DurationInterval <ScheduleInterval> [-IsUtc]
[-RecurCount <Int32>] [-ScheduleString] [-Start <DateTime>] [-DisableWildcardHandling]
[-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]
RecurrenceWeeklyWithEnd
New-CMSchedule -DayOfWeek <DayOfWeek> -End <DateTime> [-IsUtc] [-RecurCount <Int32>] [-ScheduleString]
[-Start <DateTime>] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]
[<CommonParameters>]
RecurMonthlyByWeekday
New-CMSchedule -DayOfWeek <DayOfWeek> [-IsUtc] [-OffsetDay <Int32>] [-RecurCount <Int32>] [-ScheduleString]
[-Start <DateTime>] -WeekOrder <ScheduleWeekOrder> [-DisableWildcardHandling] [-ForceWildcardHandling]
[-WhatIf] [-Confirm] [<CommonParameters>]
RecurMonthlyByWeekdayWithDuration
New-CMSchedule -DayOfWeek <DayOfWeek> -DurationCount <Int32> -DurationInterval <ScheduleInterval> [-IsUtc]
[-OffsetDay <Int32>] [-RecurCount <Int32>] [-ScheduleString] [-Start <DateTime>]
-WeekOrder <ScheduleWeekOrder> [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]
[<CommonParameters>]
RecurMonthlyByWeekdayWithEnd
New-CMSchedule -DayOfWeek <DayOfWeek> -End <DateTime> [-IsUtc] [-OffsetDay <Int32>] [-RecurCount <Int32>]
[-ScheduleString] [-Start <DateTime>] -WeekOrder <ScheduleWeekOrder> [-DisableWildcardHandling]
[-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]
RecurrenceNoneWithDuration
New-CMSchedule -DurationCount <Int32> -DurationInterval <ScheduleInterval> [-IsUtc] [-Nonrecurring]
[-ScheduleString] [-Start <DateTime>] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]
[<CommonParameters>]
RecurMonthlyLastDayOfMonthWithDuration
New-CMSchedule -DurationCount <Int32> -DurationInterval <ScheduleInterval> [-IsUtc] [-LastDayOfMonth]
[-RecurCount <Int32>] [-ScheduleString] [-Start <DateTime>] [-DisableWildcardHandling]
[-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]
RecurrenceIntervalWithDuration
New-CMSchedule -DurationCount <Int32> -DurationInterval <ScheduleInterval> [-IsUtc] -RecurCount <Int32>
-RecurInterval <ScheduleInterval> [-ScheduleString] [-Start <DateTime>] [-DisableWildcardHandling]
[-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]
RecurrenceNoneWithEnd
New-CMSchedule -End <DateTime> [-IsUtc] [-Nonrecurring] [-ScheduleString] [-Start <DateTime>]
[-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]
RecurMonthlyLastDayOfMonthWithEnd
New-CMSchedule -End <DateTime> [-IsUtc] [-LastDayOfMonth] [-RecurCount <Int32>] [-ScheduleString]
[-Start <DateTime>] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]
[<CommonParameters>]
RecurrenceIntervalWithEnd
New-CMSchedule -End <DateTime> [-IsUtc] -RecurCount <Int32> -RecurInterval <ScheduleInterval> [-ScheduleString]
[-Start <DateTime>] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]
[<CommonParameters>]
RecurMonthlyLastDayOfMonth
New-CMSchedule [-IsUtc] [-LastDayOfMonth] [-RecurCount <Int32>] [-ScheduleString] [-Start <DateTime>]
[-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]
RecurrenceInterval
New-CMSchedule [-IsUtc] -RecurCount <Int32> -RecurInterval <ScheduleInterval> [-ScheduleString]
[-Start <DateTime>] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]
[<CommonParameters>]
DESCRIPTION
Cmdleten New-CMSchedule skapar en schematoken i Konfigurationshanteraren. Skapa schematoken för att schemalägga händelser med olika frekvenser, till exempel varje dag, varje vecka och varje månad.
Om du vill avkoda schematoken till och från en intervallsträng använder du cmdleten Convert-CMSchedule. Du kan sedan använda intervallsträngarna för att ange schemaegenskaper när du definierar eller ändrar Konfigurationshanteraren objekt.
Anteckning
Kör Konfigurationshanteraren cmdlets från Konfigurationshanteraren platsenhet, till exempel PS XYZ:\>
. Mer information finns i Komma igång.
EXAMPLES
Exempel 1: Skapa en schematoken
Det här kommandot skapar en schematoken som anger att händelsen inträffar den sista dagen i månaden på angivet datum och tid (onsdag 5 augusti 2020 17:46:03 Pacific, sommartid).
$schedToken1 = New-CMSchedule -DayOfMonth 0 -Start "2020-08-05T17:46:03.7236084-07:00"
Exempel 2: Skapa ett förskjutningsschema
I följande exempel skapas följande schema:
- Startar det aktuella datumet
- Den andra måndagen i månaden
- Upprepas en gång
$schedToken2 = New-CMSchedule -Start (Get-Date) -DayOfWeek Monday -WeekOrder Second -RecurCount 1 -OffsetDay 0
Exempel 3: Skapa ett schema för daglig körning
Det här exemplet skapar ett enkelt schema som inträffar dagligen för alltid. Du kan använda den här typen av schema när du distribuerar en konfigurationsbaslinje.
New-CMSchedule -DurationInterval Days -DurationCount 0 -RecurInterval Days -RecurCount 1
PARAMETERS
-Confirm
Uppmanar dig att bekräfta innan du kör cmdleten.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-DayOfMonth
Anger den dag i månaden då händelsen inträffar. Giltiga värden sträcker sig från 0 till 31. Standardvärdet är 0
, som anger den sista dagen i månaden.
Type: Int32
Parameter Sets: RecurrenceMonthlyByDate, RecurrenceMonthlyByDateWithDuration, RecurrenceMonthlyByDateWithEnd
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-DayOfWeek
Anger den veckodag då händelsen inträffar.
Type: DayOfWeek
Parameter Sets: RecurrenceWeekly, RecurrenceWeeklyWithDuration, RecurrenceWeeklyWithEnd, RecurMonthlyByWeekday, RecurMonthlyByWeekdayWithDuration, RecurMonthlyByWeekdayWithEnd
Aliases:
Accepted values: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-DisableWildcardHandling
Den här parametern behandlar jokertecken som värden för literaltecken. Du kan inte kombinera den med ForceWildcardHandling.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-DurationCount
Anger det antal dagar då den schemalagda händelsen inträffar. Giltiga värden sträcker sig från 0 till 31. Standardvärdet är 0
, vilket indikerar att den schemalagda åtgärden fortsätter på obestämd tid.
Type: Int32
Parameter Sets: RecurrenceMonthlyByDateWithDuration, RecurrenceWeeklyWithDuration, RecurMonthlyByWeekdayWithDuration, RecurrenceNoneWithDuration, RecurMonthlyLastDayOfMonthWithDuration, RecurrenceIntervalWithDuration
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-DurationInterval
Anger den tid då händelsen inträffar.
Type: ScheduleInterval
Parameter Sets: RecurrenceMonthlyByDateWithDuration, RecurrenceWeeklyWithDuration, RecurMonthlyByWeekdayWithDuration, RecurrenceNoneWithDuration, RecurMonthlyLastDayOfMonthWithDuration, RecurrenceIntervalWithDuration
Aliases:
Accepted values: Minutes, Hours, Days
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-End
Anger datum och tid när den schemalagda händelsen slutar.
Type: DateTime
Parameter Sets: RecurrenceMonthlyByDateWithEnd, RecurrenceWeeklyWithEnd, RecurMonthlyByWeekdayWithEnd, RecurrenceNoneWithEnd, RecurMonthlyLastDayOfMonthWithEnd, RecurrenceIntervalWithEnd
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ForceWildcardHandling
Den här parametern bearbetar jokertecken och kan leda till oväntat beteende (rekommenderas inte). Du kan inte kombinera den med DisableWildcardHandling.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IsUtc
Anger att tiden är Coordinated Universal Time (UTC).
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-LastDayOfMonth
Anger att händelsen inträffar månadsvis den sista dagen i månaden.
Type: SwitchParameter
Parameter Sets: RecurMonthlyLastDayOfMonthWithDuration, RecurMonthlyLastDayOfMonthWithEnd, RecurMonthlyLastDayOfMonth
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Nonrecurring
Anger att den schemalagda händelsen inte upprepas.
Type: SwitchParameter
Parameter Sets: RecurrenceNone, RecurrenceNoneWithDuration, RecurrenceNoneWithEnd
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-OffsetDay
Från och med version 1906 använder du den här parametern för att konfigurera en offset, till exempel månadsvis efter veckodag.
Type: Int32
Parameter Sets: RecurMonthlyByWeekday, RecurMonthlyByWeekdayWithDuration, RecurMonthlyByWeekdayWithEnd
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-RecurCount
Anger antalet upprepningar för den schemalagda händelsen.
Type: Int32
Parameter Sets: RecurrenceMonthlyByDate, RecurrenceMonthlyByDateWithDuration, RecurrenceMonthlyByDateWithEnd, RecurrenceWeekly, RecurrenceWeeklyWithDuration, RecurrenceWeeklyWithEnd, RecurMonthlyByWeekday, RecurMonthlyByWeekdayWithDuration, RecurMonthlyByWeekdayWithEnd, RecurMonthlyLastDayOfMonthWithDuration, RecurMonthlyLastDayOfMonthWithEnd, RecurMonthlyLastDayOfMonth
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: Int32
Parameter Sets: RecurrenceIntervalWithDuration, RecurrenceIntervalWithEnd, RecurrenceInterval
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-RecurInterval
Anger den tid då den schemalagda händelsen upprepas.
Type: ScheduleInterval
Parameter Sets: RecurrenceIntervalWithDuration, RecurrenceIntervalWithEnd, RecurrenceInterval
Aliases:
Accepted values: Minutes, Hours, Days
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ScheduleString
Anger att schematoken konverteras till en intervallsträng.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Starta
Anger datum och tid när den schemalagda händelsen inträffar.
Type: DateTime
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WeekOrder
Anger den vecka i månaden då händelsen inträffar. Standardvärdet är Last
(0).
Type: ScheduleWeekOrder
Parameter Sets: RecurMonthlyByWeekday, RecurMonthlyByWeekdayWithDuration, RecurMonthlyByWeekdayWithEnd
Aliases:
Accepted values: Last, First, Second, Third, Fourth
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Visar vad som skulle hända om cmdleten kördes. Cmdleten körs inte.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
Denna cmdlet har stöd för parametrarna -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction och -WarningVariable. Mer information finns i about_CommonParameters.