Management Center

Scheduled Maintenance Cmdlets

The following are the lists of commands to schedule event maintenance.

Arguments in bold are mandatory.

Get-AmcSchedules

Retrieves all scheduled maintenance entries.

Return value: MaintenanceHelper.SchedulesDto

Remove-AmcSchedule

Remove a schedule with the specified job Id.

Return value: Void

Arguments Argument Description
JobId (String) Numeric identifier for the job to delete, as indicated by Get-AmcSchedules

Set-AmcEnableSchedule

Allows a maintenance schedule to be enabled.

Return value: Void

Arguments Argument Description
JobId (String) Numeric identifier for the job to be enabled, as indicated by Get-AmcSchedules

Set-AmcDisableSchedule

Allows a maintenance schedule to be disabled.

Return value: Void

Arguments Argument Description
JobId (String) Numeric identifier for the job to be disabled, as indicated by Get-AmcSchedules

New-AmcScheduleRemoveEventsFromDeploymentGroup

Adds a new schedule to delete events from the specified deployment group on the specified day each week.

Return value: Void

Arguments Argument Description
GroupName (String) The name of the deployment group from which the events are to be removed.
Description (String) Free text field for the administrator to specify the purpose of this scheduled entry, or any other details of their choosing.
DayOfWeek (DayOfWeek) The day each week that the action should be carried out. Its value ranges from zero (which indicates Sunday) to six (which indicates Saturday).
StartTimeInUTC (String) A string representing the UTC time of day that the requested action should begin. Must be parsable into a .Net System.DateTime value.
MaxRunHours (Int) How long the action should run. Even if the job is late in being started (e.g. machine is powered off), the finish time is always StartTimeInUTC + MaxRunHours.
BatchSize (Int) Number of rows to be affected within each batch transaction.
BatchDelay (TimeSpan) Amount of time in seconds that SQL will pause to allow other transactions to process so preventing transaction locks.

New-AmcScheduleRemoveEventsOlderThan

Adds a new schedule to delete events that are older than the number of days specified.

Return value: Void

Arguments

Argument Description

Days (Int)

The maximum age of events that should be retained.

Description (String)

Free text field for the administrator to specify the purpose of this scheduled entry, or any other details of their choosing.

DayOfWeek (DayOfWeek)

The day each week that the action should be carried out. Its value ranges from zero (which indicates Sunday) to six (which indicates Saturday).

StartTimeInUTC (String)

A string representing the UTC time of day that the requested action should begin. Must be parsable into a .Net System.DateTime value.

MaxRunHours (Int)

How long the action should run. Even if the job is late in being started (e.g. machine is powered off), the finish time is always StartTimeInUTC + MaxRunHours.

BatchSize (Int)

Number of rows to be affected within each batch transaction.

BatchDelay (TimeSpan)

Amount of time in seconds that SQL will pause to allow other transactions to process so preventing transaction locks.

New-AmcScheduleRemoveEventsWithId

Creates a job schedule entry to delete all events with the specified ID.

Return value: Void

Arguments Argument Description
EventId (Int) The Event Log numeric identifier for the events that are to be deleted
Description (String) Free text field for the administrator to specify the purpose of this scheduled entry, or any other details of their choosing.
DayOfWeek (DayOfWeek) The day each week that the action should be carried out. Its value ranges from zero (which indicates Sunday) to six (which indicates Saturday).
StartTimeInUTC (String) A string representing the UTC time of day that the requested action should begin. Must be parsable into a .Net System.DateTime value.
MaxRunHours (Int) How long the action should run. Even if the job is late in being started (e.g. machine is powered off), the finish time is always StartTimeInUTC + MaxRunHours.
BatchSize (Int) Number of rows to be affected within each batch transaction.
BatchDelay (TimeSpan) Amount of time in seconds that SQL will pause to allow other transactions to process so preventing transaction locks.

New-AmcScheduleRemoveEventsWithIdRange

Adds a new schedule to delete events in a particular range of values from all deployment groups on the specified day each week.

Return value: Void

Arguments Argument Description
StartEventId (Int) The Event Log numeric identifier for the start of the range of values to be deleted.
EndEventId (Int) The Event Log numeric identifier for the end of the range of values to be deleted.
Description (String) Free text field for the administrator to specify the purpose of this scheduled entry, or any other details of their choosing.
DayOfWeek (DayOfWeek) The day each week that the action should be carried out. Its value ranges from zero (which indicates Sunday) to six (which indicates Saturday).
StartTimeInUTC (String) A string representing the UTC time of day that the requested action should begin. Must be parsable into a .Net System.DateTime value.
MaxRunHours (Int) How long the action should run. Even if the job is late in being started (e.g. machine is powered off), the finish time is always StartTimeInUTC + MaxRunHours.
BatchSize (Int) Number of rows to be affected within each batch transaction.
BatchDelay (TimeSpan) Amount of time in seconds that SQL will pause to allow other transactions to process so preventing transaction locks.

New-AmcScheduleRemoveHighVolumeEventsOlderThan

Adds a new schedule to delete all high volume events that are older than the number of days specified.

Return value: Void

Arguments

Argument Description

Days (Int)

The maximum age of events that should be retained.

Description (String)

Free text field for the administrator to specify the purpose of this scheduled entry, or any other details of their choosing.

DayOfWeek (DayOfWeek)

The day each week that the action should be carried out. Its value ranges from zero (which indicates Sunday) to six (which indicates Saturday).

StartTimeInUTC (String)

A string representing the UTC time of day that the requested action should begin. Must be parsable into a .Net System.DateTime value.

MaxRunHours (Int)

How long the action should run. Even if the job is late in being started (e.g. machine is powered off), the finish time is always StartTimeInUTC + MaxRunHours.

BatchSize (Int)

Number of rows to be affected within each batch transaction.

BatchDelay (TimeSpan)

Amount of time in seconds that SQL will pause to allow other transactions to process so preventing transaction locks.

New-AmcScheduleRemoveOrphanedAlerts

Adds a new schedule to delete all alerts which do not have any associated events.

Return value: Void

Arguments Argument Description
Description (String) Free text field for the administrator to specify the purpose of this scheduled entry, or any other details of their choosing.
DayOfWeek (DayOfWeek) The day each week that the action should be carried out. Its value ranges from zero (which indicates Sunday) to six (which indicates Saturday).
StartTimeInUTC (String) A string representing the UTC time of day that the requested action should begin. Must be parsable into a .Net System.DateTime value.
MaxRunHours (Int) How long the action should run. Even if the job is late in being started (e.g. machine is powered off), the finish time is always StartTimeInUTC + MaxRunHours.
BatchSize (Int) Number of rows to be affected within each batch transaction.
BatchDelay (TimeSpan) Amount of time in seconds that SQL will pause to allow other transactions to process so preventing transaction locks.

Was this article useful?    

The topic was:

Inaccurate

Incomplete

Not what I expected

Other