共用方式為


Set-SmaSchedule

Applies To: System Center 2012 R2 Orchestrator, Windows Azure Pack for Windows Server

Set-SmaSchedule

Creates or modifies a schedule in Service Management Automation.

Syntax

Parameter Set: Default
Set-SmaSchedule -DayInterval <Int32> -ExpiryTime <DateTime> -Name <String> -ScheduleType <String> -StartTime <DateTime> -WebServiceEndpoint <String> [-AuthenticationType <String> ] [-Credential <PSCredential> ] [-Description <String> ] [-Port <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Set-SmaSchedule cmdlet creates or modifies a schedule in Service Management Automation. Specify the name and type of the schedule, and the start and end times.

You can modify only the description when you run this cmdlet against an existing schedule. Start time, expiry time, and day interval can only be set when creating a schedule with this cmdlet.

Parameters

-AuthenticationType<String>

Specifies the authentication type. Valid values are: Basic, Windows.

Windows is the default value. If you use Basic authentication, you must provide credentials by using the Credential parameter.

Aliases

none

Required?

false

Position?

named

Default Value

Windows

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Credential<PSCredential>

Specifies user credentials, as a PSCredential object, to use for the connection to the Service Management Automation web service. To obtain a credential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DayInterval<Int32>

Specifies an interval, in days, for the schedule.

Aliases

none

Required?

true

Position?

named

Default Value

1

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Description<String>

Provides a description for the schedule.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ExpiryTime<DateTime>

Specifies when, as a DateTime object, the schedule ends. To obtain a DateTime object, use the Get-Date cmdlet. For more information, type Get-Help Get-Date.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of a schedule.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Port<Int32>

Specifies the port number of the Service Management Automation web service.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ScheduleType<String>

Specifies the type of schedule. Valid values for this parameter are:

-- OneTimeSchedule
-- DailySchedule

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-StartTime<DateTime>

Specifies when, as a DateTime object, the schedule starts. To obtain a DateTime object, use the Get-Date cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WebServiceEndpoint<String>

Specifies the endpoint, as a URL, of the Service Management Automation web service. Include the protocol, for example, http:// or https://.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Create a schedule

The first command creates a date object by using the Get-Date cmdlet, and then stores the object in the $StartDate variable. This object reflects the current time.

The second command creates a date object by using the Get-Date cmdlet, and then stores the object in the $EndDate variable. The command specifies a future time. For more information, type Get-Help Get-Date.

The last command sets the schedule named Schedule01 to begin at the time stored in $StartDate and end at the time stored in $EndDate

PS C:\> $StartDate = Get-Date 
PS C:\> $EndDate = Get-Date -Day 12 -Month 6 -Year 2023
PS C:\> Set-SmaSchedule -StartTime $StartDate -ExpiryTime $EndDate -Name "Schedule01" -ScheduleType "DailySchedule" -WebServiceEndpoint "https://contoso.com/app01" 

Get-SmaSchedule

Remove-SmaSchedule