Edit

Share via


Set-CMSiteMaintenanceTask

Change settings for a Configuration Manager maintenance task.

Syntax

SetSummaryTaskByName (Default)

Set-CMSiteMaintenanceTask
    -SummaryTask <SummaryTask>
    [-FixedRun]
    [-RunIntervalMins <Int32>]
    [-RunNow]
    [-PassThru]
    [-SiteCode <String>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetMaintenanceTasksByValue

Set-CMSiteMaintenanceTask
    -InputObject <IResultObject>
    [-BeginTime <DateTime>]
    [-DaysOfWeek <DaysOfWeek[]>]
    [-DeleteOlderThanDays <Int32>]
    [-DeviceName <String>]
    [-EnableAlert <Boolean>]
    [-Enabled <Boolean>]
    [-LatestBeginTime <DateTime>]
    [-SiteBackupPath <String>]
    [-SqlBackupPath <String>]
    [-PassThru]
    [-SiteCode <String>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetMaintenanceTasksByTaskName

Set-CMSiteMaintenanceTask
    -Name <String>
    [-BeginTime <DateTime>]
    [-DaysOfWeek <DaysOfWeek[]>]
    [-DeleteOlderThanDays <Int32>]
    [-DeviceName <String>]
    [-EnableAlert <Boolean>]
    [-Enabled <Boolean>]
    [-LatestBeginTime <DateTime>]
    [-SiteBackupPath <String>]
    [-SqlBackupPath <String>]
    [-PassThru]
    [-SiteCode <String>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetMaintenanceTasksByName

Set-CMSiteMaintenanceTask
    -MaintenanceTask <MaintenanceTask>
    [-BeginTime <DateTime>]
    [-DaysOfWeek <DaysOfWeek[]>]
    [-DeleteOlderThanDays <Int32>]
    [-DeviceName <String>]
    [-EnableAlert <Boolean>]
    [-Enabled <Boolean>]
    [-LatestBeginTime <DateTime>]
    [-SiteBackupPath <String>]
    [-SqlBackupPath <String>]
    [-PassThru]
    [-SiteCode <String>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-CMSiteMaintenanceTask cmdlet changes settings for a Configuration Manager maintenance task. For more information, see Maintenance tasks.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Set a maintenance task to run once a week

This example specifies that the maintenance task named Backup SMS Site Server runs on Friday each week on the Configuration Manager site that has the site code CM1.

Set-CMSiteMaintenanceTask -SiteCode "CM1" -MaintenanceTaskName "Backup SMS Site Server" -DaysOfWeek Friday

Example 2: Configure backup destinations

Set-CMSiteMaintenanceTask -Name $TaskName -SiteBackupPath "c:\site-backup" -SqlBackupPath "c:\sql-backup" -BeginTime (Get-Date) -DaysOfWeek Sunday,Monday -EnableAlert $true -Enabled $true

Parameters

-BeginTime

Specify the date and time at which a maintenance task starts.

Parameter properties

Type:DateTime
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetMaintenanceTasksByValue
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByTaskName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DaysOfWeek

Specify an array of day names that determine the days of each week on which the maintenance task runs.

Parameter properties

Type:

DaysOfWeek[]

Default value:None
Accepted values:Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
Supports wildcards:False
DontShow:False

Parameter sets

SetMaintenanceTasksByValue
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByTaskName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DeleteOlderThanDays

For maintenance tasks that delete aged data, use this parameter to specify the number of days.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DeleteOlderThan, DeleteThanOlderDays

Parameter sets

SetMaintenanceTasksByValue
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByTaskName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DeviceName

Specifies the name of the device on which the maintenance task runs.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetMaintenanceTasksByValue
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByTaskName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableAlert

Set this parameter to $true to enable alerts for task failures, if the task supports it.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False
Aliases:EnabledAlert

Parameter sets

SetMaintenanceTasksByValue
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByTaskName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Enabled

Indicates whether the maintenance task is enabled in Configuration Manager.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetMaintenanceTasksByValue
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByTaskName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FixedRun

Indicates that this cmdlet modifies the maintenance task as a fixed run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:FixedRunInterval, DisableFixedRunInterval

Parameter sets

SetSummaryTaskByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Specify the maintenance task object to configure. To get this object, use the Get-CMSiteMaintenanceTask cmdlet.

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:MaintenanceTaskObject

Parameter sets

SetMaintenanceTasksByValue
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-LatestBeginTime

Specifies a future date and time at which the maintenance task runs.

Parameter properties

Type:DateTime
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetMaintenanceTasksByValue
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByTaskName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MaintenanceTask

Specify the name of a maintenance task to configure.

Parameter properties

Type:MaintenanceTask
Default value:None
Accepted values:BackupSiteServer, CheckApplicationTitleWithInventoryInformation, ClearUndiscoveredClients, DeleteAgedApplicationRequestData, DeleteUnusedApplicationRevisions, DeleteAgedClientOperations, DeleteAgedCollectedFiles, DeleteAgedComputerAssociationData, DeleteAgedDeleteDetectionData, DeleteAgedDeviceWipeRecord, DeleteAgedDiscoveryData, DeleteAgedEnrolledDevices, DeleteAgedEndpointProtectionHealthStatusHistoryData, DeleteAgedDevicesManagedByTheExchangeServerConnector, DeleteAgedInventoryHistory, DeleteAgedLogData, DeleteAgedSoftwareMeteringData, DeleteAgedSoftwareMeteringSummaryData, DeleteAgedClientPresenceHistory, DeleteAgedNotificationTaskHistory, DeleteAgedReplicationTrackingData, DeleteAgedReplicationSummaryData, DeleteAgedStatusMessages, DeleteAgedThreatData, DeleteAgedUnknownComputers, DeleteAgedUserDeviceAffinityData, DeleteInactiveClientDiscoveryData, DeleteObsoleteAlerts, DeleteObsoleteClientDiscoveryData, DeleteObsoleteForestDiscoverySitesAndSubnets, EvaluateProvisionedAmtComputerCertificates, MonitorKeys, RebuildIndexes, SummarizeSoftwareMeteringFileUsageData, SummarizeInstalledSoftwareData, SummarizeSoftwareMeteringMonthlyUsageData, DeleteAgedDistributionPointUsageStats, DeleteAgedProxyTrafficData
Supports wildcards:False
DontShow:False

Parameter sets

SetMaintenanceTasksByName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specify the name of a maintenance task object to configure.

Parameter properties

Type:String
Default value:None
Supports wildcards:True
DontShow:False
Aliases:MaintenanceTaskName, TaskName, ItemName

Parameter sets

SetMaintenanceTasksByTaskName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PassThru

Returns an object representing the item with which you're working. By default, this cmdlet may not generate any output.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RunIntervalMins

The Set-CMSiteMaintenanceTask cmdlet changes settings for a Configuration Manager maintenance task. For more information, see Maintenance tasks.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RunIntervalMinutes

Parameter sets

SetSummaryTaskByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RunNow

Add this parameter to have Configuration Manager run the maintenance task immediately.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetSummaryTaskByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SiteBackupPath

Applies to version 2010 and later. For the Backup Site Server task, specify the Site backup destination. The site server computer account needs full control to the destination folder.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetMaintenanceTasksByValue
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByTaskName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SiteCode

Specifies the site code of the Configuration Manager site that hosts the site system role.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SqlBackupPath

Applies to version 2010 and later. For the Backup Site Server task, specify the SQL backup destination. The site server computer account needs full control to the destination folder.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetMaintenanceTasksByValue
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByTaskName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetMaintenanceTasksByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SummaryTask

Specifies a summary maintenance task.

Parameter properties

Type:SummaryTask
Default value:None
Accepted values:UpdateApplicationCatalogTables
Supports wildcards:False
DontShow:False

Parameter sets

SetSummaryTaskByName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

IResultObject