Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Create and Manage Programs in SCCM Using New-CMProgram

Microsoft System Center Configuration Manager (SCCM) is a powerful tool for managing large groups of computers running various operating systems, including Windows. One of the key features of SCCM is the ability to create and manage software deployment programs. In this article, we will explore how to create and manage programs in SCCM using the New-CMProgram cmdlet in PowerShell.

Overview of New-CMProgram

The New-CMProgram cmdlet is used to create a new program in SCCM. A program in SCCM is essentially a set of instructions that tell the client machines how to install or execute a specific piece of software. This cmdlet is part of the ConfigurationManager module, which provides a set of cmdlets for managing SCCM.

Prerequisites

Before you can use the New-CMProgram cmdlet, you need to have the following:

  1. SCCM Environment: Ensure you have a working SCCM environment.
  2. PowerShell: PowerShell installed on your management machine.
  3. ConfigurationManager Module: The ConfigurationManager module must be imported into your PowerShell session.

Importing the ConfigurationManager Module

First, you need to import the ConfigurationManager module. This module is usually located in the SCCM installation directory. Here is how you can import it:

Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1"

Connecting to the SCCM Site

Before running any SCCM cmdlets, you need to connect to your SCCM site. Use the Set-Location cmdlet to connect:

Set-Location -Path "SCCM:"

Creating a New Program

Now, let's create a new program using the New-CMProgram cmdlet. Below is an example of how to create a program that installs a simple application:

New-CMProgram -PackageId "XYZ00001" -StandardProgramName "Install Notepad++" -CommandLine "notepadplusplus_installer.exe /S" -ProgramCanRun "OnlyWhenUserIsLoggedOn" -RunMode "RunWithAdministrativeRights" -AllowUserInteraction $true -EstimatedDiskSpaceRequired 50 -EstimatedRunTimeMinutes 5 -MaximumAllowedRunTimeMinutes 10

Explanation of Parameters

  • PackageId: The ID of the package that contains the program.
  • StandardProgramName: The name of the program.
  • CommandLine: The command line that runs the program.
  • ProgramCanRun: Specifies when the program can run (e.g., "OnlyWhenUserIsLoggedOn").
  • RunMode: Specifies the mode in which the program runs (e.g., "RunWithAdministrativeRights").
  • AllowUserInteraction: Specifies whether the program allows user interaction.
  • EstimatedDiskSpaceRequired: The estimated disk space required for the program (in MB).
  • EstimatedRunTimeMinutes: The estimated run time for the program (in minutes).
  • MaximumAllowedRunTimeMinutes: The maximum allowed run time for the program (in minutes).

Verifying the Program

To verify that the program was created successfully, you can use the Get-CMProgram cmdlet:

Get-CMProgram -PackageId "XYZ00001"

This cmdlet will display the details of the program you just created.

Conclusion

Using the New-CMProgram cmdlet in PowerShell, you can easily create and manage programs in SCCM. This allows for automated and efficient software deployment across your managed devices. By understanding the parameters and how to use them, you can tailor the deployment to meet your specific needs.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.