Get-CMSiteMaintenanceTask

Get-CMSiteMaintenanceTask

Gets maintenance tasks in Configuration Manager.

Syntax

Parameter Set: SearchByName
Get-CMSiteMaintenanceTask -SiteCode <String> [-MaintenanceTaskName <String[]> ] [ <CommonParameters>]

Detailed Description

The Get-CMSiteMaintenanceTask cmdlet gets maintenance tasks in Microsoft System Center 2012 Configuration Manager. A maintenance task is a task in System Center 2012 Configuration Manager that performs maintenance on sites and databases.

Parameters

-MaintenanceTaskName<String[]>

Specifies an array of names for maintenance tasks.

Aliases

ItemName

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SiteCode<String>

Specifies the site code of the Configuration Manager site.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

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: Get a maintenance task

This command gets the maintenance task named Backup for the Configuration Manager site that has the site code CM1.

PS C:\> Get-CMSiteMaintnanceTask -SiteCode "CM1" -MaintenanceTaskName "Backup"

Set-CMSiteMaintenanceTask