Export (0) Print
Expand All
Expand Minimize

Set-CMProgram

Updated: February 7, 2014

Applies To: System Center 2012 R2 Configuration Manager

Set-CMProgram

Modifies a program in Configuration Manager.

Syntax

Parameter Set: SetStandardProgramByName
Set-CMProgram -Name <String> -StandardProgramName <String> [-AfterRunningType <AfterRunningType> {ConfigurationManagerLogsUserOff | ConfigurationManagerRestartsComputer | NoActionRequired | ProgramControlsRestart} ] [-Category <String> ] [-CommandLine <String> ] [-Comment <String> ] [-DisableMomAlertOnRun <Boolean> ] [-DisableProgram <Boolean> ] [-DiskSpaceRequirement <String> ] [-DiskSpaceUnit <DiskSpaceUnitType> {GB | KB | MB} ] [-DriveLetter <String> ] [-DriveMode <DriveModeType> {RenameWithUnc | RequiresDriveLetter | RequiresSpecificDriveLetter} ] [-Duration <Int32> ] [-EnableTaskSequence <Boolean> ] [-GenerateMomAlertOnFail <Boolean> ] [-ProgramAssignedType <ProgramAssignedType> {RunOnceForEveryUserWhoLogsOn | RunOnceForTheComputer} ] [-ProgramRunType <ProgramRunType> {OnlyWhenNoUserIsLoggedOn | OnlyWhenUserIsLoggedOn | WhetherOrNotUserIsLoggedOn} ] [-Reconnect <Boolean> ] [-Requirement <String> ] [-RunMode <RunModeType> {RunWithAdministrativeRights | RunWithUserRights} ] [-RunType <RunType> {Hidden | Maximized | Minimized | Normal} ] [-SuppressProgramNotifications <Boolean> ] [-UserInteraction <Boolean> ] [-WorkingDirectory <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetDeviceProgramById
Set-CMProgram -DeviceProgramName <String> -Id <String> [-CommandLine <String> ] [-CommandLineFolder <String> ] [-Comment <String> ] [-DiskSpaceRequirement <String> ] [-DiskSpaceUnit <DiskSpaceUnitType> {GB | KB | MB} ] [-DownloadProgramType <DownloadProgramType> {AsSoonAsPossible | OnlyOverFastNetwork | OnlyWhenTheDeviceIsDocked} ] [-Requirement <String> ] [-WorkingDirectory <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetDeviceProgramByName
Set-CMProgram -DeviceProgramName <String> -Name <String> [-CommandLine <String> ] [-CommandLineFolder <String> ] [-Comment <String> ] [-DiskSpaceRequirement <String> ] [-DiskSpaceUnit <DiskSpaceUnitType> {GB | KB | MB} ] [-DownloadProgramType <DownloadProgramType> {AsSoonAsPossible | OnlyOverFastNetwork | OnlyWhenTheDeviceIsDocked} ] [-Requirement <String> ] [-WorkingDirectory <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetDeviceProgramByValue
Set-CMProgram -DeviceProgramName <String> -InputObject <IResultObject> [-CommandLine <String> ] [-CommandLineFolder <String> ] [-Comment <String> ] [-DiskSpaceRequirement <String> ] [-DiskSpaceUnit <DiskSpaceUnitType> {GB | KB | MB} ] [-DownloadProgramType <DownloadProgramType> {AsSoonAsPossible | OnlyOverFastNetwork | OnlyWhenTheDeviceIsDocked} ] [-Requirement <String> ] [-WorkingDirectory <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetStandardProgramById
Set-CMProgram -Id <String> -StandardProgramName <String> [-AfterRunningType <AfterRunningType> {ConfigurationManagerLogsUserOff | ConfigurationManagerRestartsComputer | NoActionRequired | ProgramControlsRestart} ] [-Category <String> ] [-CommandLine <String> ] [-Comment <String> ] [-DisableMomAlertOnRun <Boolean> ] [-DisableProgram <Boolean> ] [-DiskSpaceRequirement <String> ] [-DiskSpaceUnit <DiskSpaceUnitType> {GB | KB | MB} ] [-DriveLetter <String> ] [-DriveMode <DriveModeType> {RenameWithUnc | RequiresDriveLetter | RequiresSpecificDriveLetter} ] [-Duration <Int32> ] [-EnableTaskSequence <Boolean> ] [-GenerateMomAlertOnFail <Boolean> ] [-ProgramAssignedType <ProgramAssignedType> {RunOnceForEveryUserWhoLogsOn | RunOnceForTheComputer} ] [-ProgramRunType <ProgramRunType> {OnlyWhenNoUserIsLoggedOn | OnlyWhenUserIsLoggedOn | WhetherOrNotUserIsLoggedOn} ] [-Reconnect <Boolean> ] [-Requirement <String> ] [-RunMode <RunModeType> {RunWithAdministrativeRights | RunWithUserRights} ] [-RunType <RunType> {Hidden | Maximized | Minimized | Normal} ] [-SuppressProgramNotifications <Boolean> ] [-UserInteraction <Boolean> ] [-WorkingDirectory <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetStandardProgramByValue
Set-CMProgram -InputObject <IResultObject> -StandardProgramName <String> [-AfterRunningType <AfterRunningType> {ConfigurationManagerLogsUserOff | ConfigurationManagerRestartsComputer | NoActionRequired | ProgramControlsRestart} ] [-Category <String> ] [-CommandLine <String> ] [-Comment <String> ] [-DisableMomAlertOnRun <Boolean> ] [-DisableProgram <Boolean> ] [-DiskSpaceRequirement <String> ] [-DiskSpaceUnit <DiskSpaceUnitType> {GB | KB | MB} ] [-DriveLetter <String> ] [-DriveMode <DriveModeType> {RenameWithUnc | RequiresDriveLetter | RequiresSpecificDriveLetter} ] [-Duration <Int32> ] [-EnableTaskSequence <Boolean> ] [-GenerateMomAlertOnFail <Boolean> ] [-ProgramAssignedType <ProgramAssignedType> {RunOnceForEveryUserWhoLogsOn | RunOnceForTheComputer} ] [-ProgramRunType <ProgramRunType> {OnlyWhenNoUserIsLoggedOn | OnlyWhenUserIsLoggedOn | WhetherOrNotUserIsLoggedOn} ] [-Reconnect <Boolean> ] [-Requirement <String> ] [-RunMode <RunModeType> {RunWithAdministrativeRights | RunWithUserRights} ] [-RunType <RunType> {Hidden | Maximized | Minimized | Normal} ] [-SuppressProgramNotifications <Boolean> ] [-UserInteraction <Boolean> ] [-WorkingDirectory <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

The Set-CMProgram cmdlet modifies a program in Microsoft System Center 2012 Configuration Manager. Programs are commands that are associated with a System Center 2012 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.

Parameters

-AfterRunningType<AfterRunningType>

Specifies the action that occurs after the program completes successfully. Valid values are: ConfigurationManagerLogUserOff, ConfigurationManagerStartsComputer, NoActionRequired, and ProgramControlsRestart.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Category<String>

Specifies the category under which the program is displayed on the client computer.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CommandLine<String>

Specifies the command line for the program.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CommandLineFolder<String>

Specifies the folder that contains the executable program. This folder can be an absolute path on the client, or a path relative to the distribution folder that contains the package.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Comment<String>

Specifies optional text about a program, such as a description. On client computers, this text appears in Run Advertised Programs in Control Panel.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DeviceProgramName<String>

Specifies a device program name.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DisableMomAlertOnRun<Boolean>

Indicates whether the computer running the program is in maintenance mode for the duration of the program. When in maintenance mode, Microsoft Operations Manager (MOM) disables alerts while the program runs.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DisableProgram<Boolean>

Indicates whether to temporarily disable all advertisements that contain this program. If this option is selected, the program is removed from the list of available programs for users to run and it will not be run through assignment until re-enabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DiskSpaceRequirement<String>

Specifies the amount of disk space that the software program requires to run on the computer. Requires the DiskSpaceUnit parameter be set. The value must be greater than or equal to zero.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DiskSpaceUnit<DiskSpaceUnitType>

Specifies the units, GB, KB, or MB, for the DiskSpaceRequirement parameter.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DownloadProgramType<DownloadProgramType>

Specifies when the program is to run. Valid values are: AsSoonAsPossible, OnlyOverFastNetwork, and OnlyWhenTheDeviceIsLocked.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DriveLetter<String>

Specifies a drive letter to qualify the location if the DriveMode parameter is used.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DriveMode<DriveModeType>

Indicates whether the program requires a specific drive letter, specified in the DriveLetter parameter. By default, the program runs with a Universal Naming Convention (UNC) name. If DriveMode is set to RequiresDriveLetter, the program uses any available drive letter. If DriveMode is set to RequiresSpecificDriveLetter, the program only runs if the drive is not already used.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Duration<Int32>

Specifies the maximum amount of time the program is expected to run. The default value is 120 minutes.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-EnableTaskSequence<Boolean>

Indicates whether this program can be installed from the Install Software task sequence.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-GenerateMomAlertOnFail<Boolean>

Indicates whether MOM generates an application log event entry if the program fails.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Id<String>

Specifies an ID for the program.


Aliases

PackageId

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IResultObject>

Specifies a CMProgram object. To obtain a CMProgram object, use the Get-CMProgram cmdlet.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies a name for the program.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ProgramAssignedType<ProgramAssignedType>

Specifies whether the program runs once on the computer, or once for every user who logs on to the computer. The default setting is RunOnceForTheComputer. The program is only assigned to users when the ProgramRunType parameter is set to OnlyWhenUserIsLoggedOn.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ProgramRunType<ProgramRunType>

Specifies the logon conditions that are necessary for the program to run. Valid values are: OnlyWhenNoUserIsLoggedOn, OnlyWhenUserIsLoggedOn, and WhetherOrNotUserIsLoggedOn. The default setting is OnlyWhenUserIsLoggedOn.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Reconnect<Boolean>

Indicates whether the client computer reconnects to the distribution point when the user logs on.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Requirement<String>

Specifies any additional requirements for standard or device programs.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-RunMode<RunModeType>

Specifies the credentials the client computer requires to run the program, either RunWithAdministrativeRights or RunWithUserRights.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-RunType<RunType>

Specifies the mode is which the program will run on the client computer. Valid values are: Hidden, Maximized, Minimized, and Normal. The default is Normal.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-StandardProgramName<String>

Specifies the standard program name.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SuppressProgramNotifications<Boolean>

Indicates whether to display notification area icons and messages, as well as countdown notifications, for this program.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-UserInteraction<Boolean>

Indicates whether to allow users to interact with the program.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-WorkingDirectory<String>

Specifies a working directory for the program.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

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: Modify a standard program

This command modifies a standard program.


PS C:\> Set-CMProgram -Name "Test" -StandardProgramName SPM -Comment "Standard Upgrades" -CommandLine "RunThisNow" -RunType Maximized -AfterRunningType ProgramControlsRestart -Category "Laptops" -DiskSpaceRequirement 50 -DiskSpaceUnit MB -Duration 150 -Requirement 4 -Reconnect $False -SuppressProgramNotifications $False -DisableProgram $True -EnableTaskSequence $True -DisableMomAlertOnRun $True -GenerateMomAlertOnFail $True

Example 2: Modify a device program

This command modifies a device program.


PS C:\> Set-CMProgram -Name "Test" -DeviceProgramName DPM -Comment "Upgrades for December" -CommandLine "RunMe" -WorkingDirectory "\TempWork" -CommandLineFolder "C:\Windows" -DiskSpaceRequirement 30 -DiskSpaceUnit MB -DownloadProgramType AsSoonAsPossible -Requirement "All previous device updates"

Related topics

 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft