Disable-CMProgram

Disables programs in Configuration Manager packages.

Syntax

Disable-CMProgram
       [-Confirm]
       [-DisableWildcardHandling]
       [-ForceWildcardHandling]
       -InputObject <IResultObject>
       [-PassThru]
       [-WhatIf]
       [<CommonParameters>]
Disable-CMProgram [-Confirm] [-DisableWildcardHandling] [-ForceWildcardHandling] -PackageId 
 [-PassThru] -ProgramName  [-WhatIf] []
Disable-CMProgram [-Confirm] [-DisableWildcardHandling] [-ForceWildcardHandling] -PackageName 
 [-PassThru] -ProgramName  [-WhatIf] []

Description

The Disable-CMProgram cmdlet disables one or more programs in Microsoft System Center Configuration Manager packages. Programs are commands that are associated with a System Center Configuration Manager package. Programs identify the actions that occur when the client receives the client package. You can associate multiple programs with the same package.

You can disable a program to prevent System Center Configuration Manager from running it on client computers where it is currently advertised. When you disable a program, System Center Configuration Manager still sends the program to distribution points and still advertises the Program on client computers, but Configuration Manager does not display or run the program on the client. This behavior is the same that occurs when you disable an advertisement with which the program has been associated.

Examples

Example 1: Disable a program

PS C:\>Disable-CMProgram -PackageId "CM400007" -ProgramName "ProgramD02"

This command disables the program named ProgramD02 in the package that has the ID CM400007.

Required Parameters

-InputObject

Specifies the input to this cmdlet. You can use this parameter, or you can pipe the input to this cmdlet.

Type:IResultObject
Aliases:Program
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-PackageId

Specifies an array of package IDs.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PackageName

Specifies an array of package names.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ProgramName

Specifies an array of program names.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

Indicates that wildcard handling is disabled.

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

Indicates that wildcard handling is enabled.

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

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

Type:SwitchParameter
Required:False
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
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False