Notes from the field — ConfigMgr, Intune, Windows and PowerShell by Zeng Yinghua (Sandy)

Twitter: @sandy_tsang

Category · PowerShell

PowerShell Scripts & Tools

Resources for using PowerShell in IT operations, including monitoring and automation — written up from hands-on work with ConfigMgr, Windows and Microsoft cloud services.

Back to the latest posts
Extreme close-up of a dark blue terminal window filled with rows of small monospaced command text, cool and technical in mood

What this category covers

Scripts and small tools that answer practical questions: is the laptop docked, is the WSUS pool healthy, and how do you reach Microsoft Planner from the command line?

Dock detection

Use PowerShell to detect whether a Lenovo laptop is attached to a dock — useful when behaviour or policy should change depending on the hardware in use.

WSUS pool monitoring

Check the status of the WSUS application pool so that update servicing problems are spotted before they reach the clients.

Planner connectors

PowerShell modules for Microsoft Planner, part of the July 2019 batch of posts on cloud automation and Microsoft Graph.


Monitoring before automating

Most of the scripts here started as a check: something in the environment looked wrong, and a quick query was faster than opening a console.

That pattern shows up across the site — monitoring a ConfigMgr task sequence with a status message query, watching a WSUS pool, or confirming which hardware a device is sitting on before a task sequence makes a decision.

Automation comes second: once the check is reliable, it can be wrapped into a scheduled job or a step in a deployment.

Macro view of textured fabric with soft folds and fine fibers in vivid magenta and purple tones, smooth and abstract

Related topics on the site

The PowerShell posts sit alongside the rest of the ConfigMgr, Intune and Windows material. A few starting points:

TopicWhat you will find
ConfigMgrTask sequences, client deployment and server setup, including posts from 2016 to 2019.
OSDImaging and task sequence work, such as iPXE UEFI boot without a WDS server.
IntuneAutopilot automation, policy CSP settings and Win32 application deployment.
Windows 10Upgrade troubleshooting, Windows Store apps on Server 2016 and multi-language deployment.

Posts from July 2019 also cover ConfigMgr fatal MSI errors, AdminService over the internet, and Microsoft Graph Intune Autopilot connectors.

PowerShell remains a cornerstone of modern Windows administration, offering a command-line interface that transforms repetitive tasks into repeatable, efficient scripts. For administrators working with Configuration Manager and MDT, PowerShell bridges the gap between manual intervention and automated deployment workflows. Whether querying WMI for hardware inventory or orchestrating complex task sequences, the shell's object-oriented pipeline allows precise control over Windows systems. The ability to combine native cmdlets with custom functions means that even the most intricate operational requirements can be addressed through well-structured scripts, reducing human error and freeing up time for more strategic IT work.

Monitoring the health of WSUS pools is a practical example of PowerShell's value in daily operations. Administrators can quickly assess the state of update services, check for synchronization issues, and verify that content files are properly stored. By connecting to SQL Server databases that underpin WSUS, PowerShell scripts can surface performance metrics and flag potential problems before they impact endpoint patching. This proactive approach to update management ensures that systems remain compliant and secure, while the scripted nature of these checks makes them easy to schedule and repeat across multiple servers.

Automation of application deployment through Configuration Manager benefits greatly from PowerShell integration. Scripts can trigger application installations, evaluate compliance against desired configurations, and collect detailed logging for troubleshooting failed deployments. The ability to parse MSI return codes and interpret Windows Installer output helps administrators pinpoint exactly why an installation failed on a particular system. Combined with ConfigMgr's reporting capabilities, PowerShell provides a feedback loop that refines deployment strategies over time, ensuring that applications reach end users reliably and with minimal disruption.

For those working with Microsoft Intune and modern device management, PowerShell extends its utility into cloud-connected environments. Graph API integration allows scripts to manage Azure AD objects, configure device compliance policies, and automate enrollment workflows for Windows Autopilot. The same scripting skills that apply to on-premises systems transfer naturally to cloud services, making PowerShell a unifying tool across hybrid infrastructures. As organizations adopt mobility and enterprise mobility management strategies, the ability to write scripts that span both local and cloud boundaries becomes increasingly essential for efficient IT operations.

Browse the latest posts on the home page or follow along on Twitter at @sandy_tsang.