The night sky with stars and clouds above a road

Creating an SCCM Package to Configure High-Performance Power Plan

Overview

This post provides a that creates an SCCM package to configure systems to use the High-Performance power plan. This configuration is particularly useful for workstations running resource-intensive applications where maximum performance is required. By deploying this configuration through SCCM, you can ensure that all targeted systems are consistently optimized for high performance.

Instructions

  1. Copy the provided to a location on your SCCM server.
  2. Adjust the script variables such as $SiteCode and $PackageSourcePath to align with your specific environment.
  3. Execute the script in PowerShell to generate the SCCM package.
  4. Distribute the package to the appropriate distribution points within SCCM.
  5. Monitor the deployment to ensure that the High-Performance power plan is activated on all targeted systems.

What the Script Does

This PowerShell script automates the creation of an SCCM package that sets the system power plan to High-Performance. The High-Performance power plan is designed to maximize system performance by preventing the system from entering lower power states, which can be beneficial for workstations that run demanding applications.

PowerShell Script

# Define Variables
$ScriptName = "Configure-Power-Plan-For-Performance"
$ScriptDescription = "Configures the system to use the High-Performance power plan to optimize system performance."
$PackageSourcePath = "C:\Scripts\$ScriptName"
# Load SCCM PowerShell Module
Import-Module "$($Env:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" -Force
$SiteCode = "YourSiteCode"
cd "$SiteCode`:"
# Check if a package with the same name exists and delete it
$ExistingPackages = Get-CMPackage -Name $ScriptName -ErrorAction SilentlyContinue
if ($ExistingPackages) {
    foreach ($Package in $ExistingPackages) {
        Remove-CMPackage -Id $Package.PackageID -Force
    }
}
# Create the Package Source Directory if it does not exist
if (!(Test-Path -Path $PackageSourcePath)) {
    New-Item -ItemType Directory -Path $PackageSourcePath -Force
}
# Create the PowerShell script
$ScriptContent = @'
powercfg -setactive SCHEME_MIN
'@
$ScriptPath = "$PackageSourcePath\$ScriptName.ps1"
Set-Content -Path $ScriptPath -Value $ScriptContent
# Create the SCCM Package
$Package = New-CMPackage `
    -Name $ScriptName `
    -Description $ScriptDescription `
    -Path $PackageSourcePath
# Create a Program for the Package
$Program = New-CMProgram `
    -PackageName $ScriptName `
    -StandardProgramName $ScriptName `
    -CommandLine "powershell.exe -ExecutionPolicy Bypass -File $ScriptPath" `
    -ProgramRunType "WhetherOrNotUserIsLoggedOn"
# Distribute the Package to the Distribution Point but do not deploy
Start-CMContentDistribution `
    -PackageName $ScriptName `
    -DistributionPointName "YourDistributionPointName"

Explanation

By using this PowerShell script, you automate the process of configuring the High-Performance power plan across multiple systems via SCCM. This approach ensures that all targeted systems are set to deliver maximum performance, which is particularly beneficial for users running applications that require significant computational resources. Deploying this setting through SCCM allows for consistent and controlled configuration across your environment.

Tags:

#Performance #PowerShell #PowerPlan #SCCM

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

WordPress Cookie Plugin by Real Cookie Banner