Set-CMSiteMaintenanceTask

Changes settings for a Configuration Manager maintenance task.

Syntax

Set-CMSiteMaintenanceTask
   [-DeleteOlderThanDays <Int32>]
   [-DeviceName <String>]
   [-Enabled <Boolean>]
   [-BeginTime <DateTime>]
   [-LatestBeginTime <DateTime>]
   [-DaysOfWeek <DaysOfWeek[]>]
   [-EnableAlert <Boolean>]
   -InputObject <IResultObject>
   [-SiteCode <String>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMSiteMaintenanceTask
   [-DeleteOlderThanDays <Int32>]
   [-DeviceName <String>]
   -TaskName <String>
   [-Enabled <Boolean>]
   [-BeginTime <DateTime>]
   [-LatestBeginTime <DateTime>]
   [-DaysOfWeek <DaysOfWeek[]>]
   [-EnableAlert <Boolean>]
   [-SiteCode <String>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMSiteMaintenanceTask
   [-DeleteOlderThanDays <Int32>]
   [-DeviceName <String>]
   -MaintenanceTask <MaintenanceTask>
   [-Enabled <Boolean>]
   [-BeginTime <DateTime>]
   [-LatestBeginTime <DateTime>]
   [-DaysOfWeek <DaysOfWeek[]>]
   [-EnableAlert <Boolean>]
   [-SiteCode <String>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMSiteMaintenanceTask
   -SummaryTask <SummaryTask>
   [-RunNow]
   [-RunIntervalMins <Int32>]
   [-FixedRun]
   [-SiteCode <String>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-CMSiteMaintenanceTask cmdlet changes settings for a Microsoft System Center Configuration Manager maintenance task.

Examples

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

PS C:\> Set-CMSiteMaintenanceTask -SiteCode "CM1" -MaintenanceTaskName "Backup" -DaysOfWeek Friday

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

Required Parameters

-InputObject
Type:IResultObject
Aliases:MaintenanceTaskObject
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-MaintenanceTask

Specifies the name of a maintenance task. The acceptable values for this parameter are:

  • BackupConfigMgrSecondarySiteServer
  • BackupSiteServer
  • CheckApplicationTitleWithInventoryInformation
  • ClearUndiscoveredClients
  • DeleteAgedApplicationRequestData
  • DeleteAgedClientAccessLicenseData
  • DeleteAgedClientOperations
  • DeleteAgedClientPresenceHistory
  • DeleteAgedCollectedFiles
  • DeleteAgedComputerAssociationData
  • DeleteAgedConfigurationManagementData
  • DeleteAgedDeleteDetectionData
  • DeleteAgedDevicesManagedByTheExchangeServerConnector
  • DeleteAgedDeviceWipeRecord
  • DeleteAgedDiscoveryData
  • DeleteAgedEndpointProtectionHealthStatusHistoryData
  • DeleteAgedEnrolledDevices
  • DeleteAgedInventoryHistory
  • DeleteAgedLogData
  • DeleteAgedNotificationTaskHistory
  • DeleteAgedReplicationSummaryData
  • DeleteAgedReplicationTrackingData
  • DeleteAgedSoftwareMeteringData
  • DeleteAgedStatusMessages
  • DeleteAgedThreatData
  • DeleteAgedUnknownComputers
  • DeleteAgedUserDeviceAffinityData
  • DeletedAgedClientPresenceHistory
  • DeleteExpiredActivities
  • DeleteExpiredActivityFacts
  • DeleteExpiredBookmarks
  • DeleteInactiveClientDiscoveryData
  • DeleteObsoleteAlerts
  • DeleteObsoleteClientDiscoveryData
  • DeleteObsoleteForestDiscoverySitesAndSubnets
  • DeleteUnusedApplicationRevisions
  • EvaluateProvisionedAmtComputerCertificates
  • ExportSiteDatabaseTransactionLog
  • MonitorKeys
  • RebuildIndexes
  • ResetAmtComputerPasswords
  • SiteDatabase
  • SummarizeClientAccessLicenseWeeklyUsageData
  • SummarizeInstalledSoftwareData
  • SummarizeSoftwareMeteringFileUsageData
  • SummarizeSoftwareMeteringMonthlyUsageData
  • UpdateStatistics
Type:MaintenanceTask
Parameter Sets: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
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SummaryTask

Specifies a summary maintenance task. The acceptable value for this parameter is UpdateApplicationCatalogTables.

Type:SummaryTask
Parameter Sets:UpdateApplicationCatalogTables
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TaskName
Type:String
Aliases:Name, MaintenanceTaskName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-BeginTime

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

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DaysOfWeek

Specifies an array of day names that determine the days of each week on which the maintenance task runs. The acceptable values for this parameter are:

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday
Type:DaysOfWeek[]
Parameter Sets:Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DeleteOlderThanDays
Type:Int32
Aliases:DeleteOlderThan, DeleteThanOlderDays
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DeviceName

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

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EnableAlert
Type:Boolean
Aliases:EnabledAlert
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Enabled

Indicates whether the maintenance task is enabled in Configuration Manager.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-FixedRun

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

Type:SwitchParameter
Aliases:FixedRunInterval, DisableFixedRunInterval
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-LatestBeginTime

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

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PassThru
Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunIntervalMins
Type:Int32
Aliases:RunIntervalMinutes
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunNow

Indicates whether Configuration Manager runs the maintenance task immediately.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SiteCode

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

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False