Set-CMProgram

Set-CMProgram

Modifies a program in Configuration Manager.

構文

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>]

詳細説明

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.

パラメーター

-AfterRunningType<AfterRunningType>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Category<String>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-CommandLine<String>

Specifies the command line for the program.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-DeviceProgramName<String>

Specifies a device program name.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-DiskSpaceUnit<DiskSpaceUnitType>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-DownloadProgramType<DownloadProgramType>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-DriveLetter<String>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Duration<Int32>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-EnableTaskSequence<Boolean>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-GenerateMomAlertOnFail<Boolean>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Id<String>

Specifies an ID for the program.

エイリアス

PackageId

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-InputObject<IResultObject>

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

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Name<String>

Specifies a name for the program.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Reconnect<Boolean>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Requirement<String>

Specifies any additional requirements for standard or device programs.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-RunMode<RunModeType>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-StandardProgramName<String>

Specifies the standard program name.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-SuppressProgramNotifications<Boolean>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-UserInteraction<Boolean>

Indicates whether to allow users to interact with the program.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-WorkingDirectory<String>

Specifies a working directory for the program.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

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"

関連トピック

Disable-CMProgram

Enable-CMProgram

Get-CMProgram

New-CMProgram

Remove-CMProgram