Showing posts with label SCCM Automation. Show all posts
Showing posts with label SCCM Automation. Show all posts

Automating a Smart Windows 11 Upgrade Using PsExec, PowerShell, and SCCM-Ready Logic

 

Upgrading enterprise devices to Windows 11 at scale requires careful orchestration. Devices must meet hardware requirements, have enough disk space, maintain user productivity, and ensure minimal disruption. This Smart Windows 11 Upgrade solution delivers a fully automated, resilient, and user-aware upgrade workflow using PsExec, batch scripting, and PowerShell automation.

This implementation is designed for enterprise environments, ensuring reliability, fallback mechanisms, logging, and compliance checks before initiating the in-place upgrade (IPU).


  • 🚀 Solution Overview

This solution consists of three major components:

  1. PsExec Launcher (Remote Execution Layer)
  2. Batch Script (Content Distribution & Trigger Layer)
  3. PowerShell Scripts (Logic, Validation & Upgrade Execution)

Together, they create a robust and self-healing upgrade workflow.


  • 🔹 1. Remote Execution Using PsExec

The process begins with:

PowerShell

psexec @file.txt -s -h -d -c -f DC_SmartUpgrade.bat

``

Show more lines

  • Key Features:
  • @file.txt → Targets multiple systems
  • -s → Runs as SYSTEM (highest privilege)
  • -h → Elevated execution
  • -d → Non-blocking execution
  • -c -f → Copies and overwrites the batch script
  • Purpose:

This enables mass deployment of the upgrade trigger across endpoints without requiring manual intervention.


  • 🔹 2. Batch Script – Smart Content Staging

The batch script acts as a resilient launcher and content distributor.

  • Key Capabilities:
  • Multi-Server Fallback

BAT

for %%S in ("%SERVER_SHARE1%" "%SERVER_SHARE2%" "%SERVER_SHARE3%")

Show more lines

Automating Language Pack Installation with PowerShell and SCCM

 

Managing language packs across enterprise devices is often a complex and user-dependent process. This PowerShell-based solution simplifies the entire lifecycle of language pack deployment, from user selection to installation and status tracking, making it scalable and enterprise-ready.

This implementation consists of three coordinated components:

  • Dummy Package Script (initialization and registry setup)
  • User Prompt Script (region/language selection and user interaction)
  • Installation Script (DISM-based language pack deployment)

Together, these scripts provide a complete, automated workflow for multilingual environments.


  • Overview of the Solution

The solution is designed to:

  • Allow users to select region and preferred language
  • Store selections using SCCM task sequence variables and registry
  • Install language packs dynamically using DISM
  • Provide user feedback (success/failure popups)
  • Maintain centralized logging for auditing and troubleshooting

  • 1. Dummy Package Script (Initialization Layer)

The dummy script prepares the environment by ensuring the required registry structure exists.

  • Key Functionality:
  • Creates registry path:
  • HKLM:\SOFTWARE\LPs
  • Initializes logging at:
  • C:\ProgramData\\LogFiles
  • Logs whether the registry path was newly created or already exists
  • Purpose:

This acts as a foundation step to track installation state and user selections consistently across the deployment lifecycle.


  • 2. User Prompt Script (Interactive Layer)

This script provides a Windows Forms-based UI for users to select their region and corresponding language.

  • Key Features:
  • Region-to-Language Mapping
  • Regions (Asia, Europe, America) dynamically populate language options
  • Ensures users only select valid combinations
  • Language Code Mapping

Automating dot3svc Service Configuration Using PowerShell

 

Managing Windows services across enterprise devices is a common administrative task, especially when enforcing network security policies. This PowerShell script provides a simple yet effective solution to control the startup behavior of the Wired AutoConfig service (dot3svc) by modifying its registry configuration.


  1. Overview of the Script

The script is designed to:

  • Enable or disable the dot3svc (Wired AutoConfig) service
  • Modify the service startup type via registry
  • Log all actions in a structured format
  • Support both installation (enable) and uninstallation (disable) scenarios

This makes it suitable for deployment through tools like SCCM, Intune, or automation pipelines.


  1. What is dot3svc?

The Wired AutoConfig (dot3svc) service is responsible for IEEE 802.1X authentication on wired Ethernet networks. It is commonly used in enterprise environments where:

  • Network access is controlled via authentication policies
  • Devices must comply with security standards before connecting
  • Certificate-based or credential-based authentication is enforced

Enabling or disabling this service directly impacts network access behavior and compliance.


  1. Logging Mechanism

The script includes a reusable logging function:

PowerShell

function Write-Log

``

Show more lines

  1. Key Features:
  • Logs are stored in:
  • C:\ProgramData\GlobalClient\LogFiles
  • Daily log file creation using date format
  • Captures:
    • Timestamp
    • Log level (INFO, WARNING, ERROR)
    • Message details

This ensures traceability and simplifies troubleshooting.


  1. Registry Configuration

Smart BIOS Upgrade

Automating Dell BIOS Upgrades with PowerShell in an Enterprise Environment

Managing BIOS updates across enterprise devices is often a complex and high-risk task. Firmware updates require careful coordination, user awareness, and strict safeguards such as power checks and version validation. This PowerShell solution addresses those challenges by delivering a fully automated, user-aware BIOS upgrade workflow integrated with Microsoft Configuration Manager (SCCM) task sequences.

This script combines automation, user interaction, validation logic, and a graphical interface to create a reliable and controlled BIOS upgrade process.


Overview of the Solution

The script is designed to handle the entire BIOS upgrade lifecycle, from initial detection to final verification. It performs the following key functions:

  • Detects system model and current BIOS version
  • Compares it against a predefined expected version (via JSON file)
  • Determines whether an upgrade is required
  • Prompts the user with retry options
  • Enforces AC power requirements for laptops
  • Executes the BIOS update silently
  • Displays a real-time progress UI
  • Logs all actions for auditing
  • Verifies success after reboot

This approach ensures both operational efficiency and user safety.


Dynamic BIOS File Handling

The script automatically identifies the BIOS executable located in the same directory. This avoids hardcoding file names and allows the same script package to support multiple models.

By dynamically picking the executable, administrators can easily maintain the solution by simply updating the BIOS files in the folder.


Logging and Traceability

A structured logging mechanism writes all activity to:

C:\ProgramData\GlobalClient\LogFiles

Each device generates a uniquely named log file based on its model. This makes troubleshooting straightforward and ensures full traceability for every upgrade attempt.


User-Friendly Progress Interface

A key highlight of this solution is its custom WPF-based graphical interface. Instead of leaving users unsure about what’s happening, the script displays:

  • A progress bar with percentage completion
  • Status messages indicating current steps
  • A scrolling output log
  • Corporate branding through logo integration

The UI also includes basic window controls like minimize functionality and drag movement, offering a polished and professional experience.


Integration with SCCM Task Sequences

TS Export

function Export-TSToExcel

{

    param (

        [Parameter(ParameterSetName="FromXml", Mandatory)]

        [ValidateNotNullOrEmpty()]

        [xml] $Xml,


        [Parameter(ParameterSetName="FromXmlPath", Mandatory)]

        [ValidateNotNullOrEmpty()]

        [System.IO.FileInfo] $XmlPath,


        [Parameter(ParameterSetName="FromTaskSequence", Mandatory, ValueFromPipeline)]

        [ValidateNotNullOrEmpty()]

        [object] $TaskSequence,


        [Parameter(ParameterSetName="FromTaskSequence")]

        [Parameter(ParameterSetName="FromXml")]

        [Parameter(ParameterSetName="FromXmlPath")]

        [System.IO.FileInfo] $ExportPath,


        [Parameter(ParameterSetName="FromXml")]

        [Parameter(ParameterSetName="FromXmlPath")]

        [string] $TSName = "Task Sequence",


        [Parameter(ParameterSetName="FromTaskSequence")]

        [Parameter(ParameterSetName="FromXml")]

        [Parameter(ParameterSetName="FromXmlPath")]

        [switch] $Show,


        [Parameter(ParameterSetName="FromTaskSequence")]

        [Parameter(ParameterSetName="FromXml")]

        [Parameter(ParameterSetName="FromXmlPath")]

        [switch] $Macro,


        [Parameter(ParameterSetName="FromTaskSequence")]

        [Parameter(ParameterSetName="FromXml")]

        [Parameter(ParameterSetName="FromXmlPath")]

        [switch] $Outline,

        

        [Parameter(ParameterSetName="FromTaskSequence")]

        [Parameter(ParameterSetName="FromXml")]

        [Parameter(ParameterSetName="FromXmlPath")]

        [switch] $HideProgress

    )


    try

START/ STOP services and rename any folder

Hey Guys, What's up? 

 

Today we are going to automate and deploy the below tasks.

Stop Services

Perform Operations (rename folder)

Start Services

 

How?

Update WoLWAN settings on Wireless Adaptor

Hello Guys,

As an SCCM administrator, we are receiving the requirement to deploy applications, patches, application updates post OSD.

Sometimes we have to modify the OS-related settings like if a particular file is present on the machine, then run remediation script OR if a particular setting is present on the machine, then change it with new settings.

In this scenario, we are going to change the Wireless Adaptor settings related to Power Management.

Yes, I am talking about Wake on LAN settings WoL. Microsoft has released Information about power management settings on a network adapter. Click HERE to read the Microsoft kb article. This article is important to learn more about the PnPCapabilities values and how to use its combinations. In this article, MS provided information on how to use the registry key if we are using this for broad deployment purposes.

Ok, here we are focusing on the Wireless adaptor and will create a PowerShell script using the above-mentioned settings in the script.

We are using the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\DeviceNumber registry settings to update the wireless settings.

SCCM SQL query to get the full OS version with build number

 Today, again we are going to create one SQL query..... 

Today we are going to pull the Operating System version with the build number. from SCCM SQL database.

For a single machine, you can run the command "Winver" from the run and you will get the below information

Operating System build version

SCCM SQL query to get machines with user id, name, email, last logon

Hello Friends, Good evening and how are you?

Today someone asked me to create one SQL query to get the machine details like hostname, IP Address, RAM, total HDD size, Free Space, Manufacturer, Model, Last Heartbeat, Users name, email ID, Last logged on user name.

Also, We will fetch the domain details and CCM client active status.

SCCM SQL Query, Machine details with User name and email ID, SQL Queries, SCCM  SQL master query, ConfigMgr SQL query, ConfigMgr, SCCM SQL reports




















Distribute multiple packages on multiple distribution points

Hello Guys, Hope you are doing well. Today we are going to automate the package distribution.

This script will help you to distribute multiple packages on multiple distribution points.

let's download the PowerShell code mentioned below and run it from any SMS Provider server.


Distribute Multiple packages on multiple distribution points


Provide Hostname and delete Machines from SCCM console - PowerShell automation

Hello Friends,

Suppose, if I have 200 machines hostname and each hostname having 2-3 machines in the SCCM console and you want to delete each machine from the console. you will be irritated doing this job manually. the reason behind it, its time-consuming activity and repetitive task.

why you are not doing smart work? how?

Let's say we have a scenario like above and you have one PowerShell script in which you added all the machines hostname into it and just run the script and it deleted all the desired machines from the console while you finish a cup of tea 😉

Yes, We can create the PowerShell script like this using ConfigurationManager.psd1 SCCM PS module.

Import the PowerShell module first and then connect to the Primary Site Server. To get the hostname of the machine from a file, we have to create one input file named "hostnameinput.txt" in the same directory where we have created and kept the PowerShell script. Once you create the input text file paste all the machines hostname into the file and runs the below script with SCCM admin privileges.

Provide MAC address and delete Machines from SCCM console

Hello Friends,

If I have 200 machines MAC Addresses and each MAC address having 2-3 machines in the SCCM console and you want to delete each machine from the console. you will be irritated doing this job manually. the reason behind it, its time-consuming activity and repetitive task.

why you are not doing smart work? how?

Let's say we have a scenario like above and you have one PowerShell script in which you added all the MAC addresses into it and just run the script and it deleted all the desired machines from the console while you finish a cup of tea 😉

Yes, We can create the PowerShell script like this using ConfigurationManager.psd1 SCCM PS module.

Import the PowerShell module first and then connect to the Primary Site Server. To get the MAC Addresses from a file, we have to create one input file named "macaddressinpput.txt" in the script root directory where we have created and kept the PowerShell script. Once you create the input text file paste all the MAC Addresses into the file and runs the below script with SCCM admin privileges.

Connect SCCM console via PowerShell

PowerShell is a more powerful tool to manage the System Center Configuration Manager.

To connect the SCCM using PowerShell, you can use the below PowerShell script.

When you execute any cmdlets or script by using the PowerShell console, your cmdlets or script will be runs in the primary site server.

Add the below line into the PS Script when you are importing the SCCM module first time on the machine.