PowerShell: Removing Software Updates from Windows

Introduction

Recently, I had the need to remove software updates from Windows servers in order to test out patching functionality in System Center Configuration Manager (SCCM / ConfigMgr). Since we’re currently deploying full patched operating system (OS) images, we didn’t really have any machines to test deploying software updates with. We’re currently working with non-production servers, so removing software updates for a few minutes and reinstalling them isn’t a big deal. I figured the easiest thing to do would be to simply remove any and all updates that could be removed (some can’t be uninstalled), so naturally, I wrote a script to handle this.

Read morePowerShell: Removing Software Updates from Windows

PowerShell: Creating the System Management Container

If you’ve ever worked with Systems Management Server (SMS) 2003 or System Center Configuration Manager (ConfigMgr / SCCM) 2007, you probably are familiar with the step of creating the “System Management” container underneath the “CN=System,DC=mydomain,DC=com” container in Active Directory. Normally you have to go into ADSIEdit.msc in order to do this, since you can’t create … Read more PowerShell: Creating the System Management Container

PowerShell: PowerEvents Module

Hey guys, I haven’t written anything new in a while, because I’ve been working on a PowerShell module called PowerEvents. PowerEvents is a module that facilitates working with WMI (Windows Management Instrumentation) permanent event registrations. You can query for and respond to events, all from within WMI! PowerEvents simply makes creating those registrations easier. For … Read more PowerShell: PowerEvents Module

PowerShell Quick Tip: Determine STA Threading Mode

Some code in PowerShell requires you to use the Single-Threaded Apartment (STA) threading model. The PowerShell version 2.0 console host uses Multi-Threaded Apartment by default. The PowerShell Integrated Scripting Environment (ISE) uses the STA threading model. If you’re writing code using the WPK module included in the PowerShellPack, you will need to ensure that you … Read more PowerShell Quick Tip: Determine STA Threading Mode

PowerShell: ConfigMgr WMI Provider (feat. Lazy Properties)

What are Lazy Properties? So if you’re a script writer, and you also use System Center Configuration Manager 2007 (ConfigMgr), you may have run into a concept called Lazy Properties. Lazy properties are certain (not all) properties on certain (not all) WMI classes, within the ConfigMgr provider namespace, that are marked with a WMI qualifier … Read more PowerShell: ConfigMgr WMI Provider (feat. Lazy Properties)

PowerShell Module: Enable Wake for Devices

So in my last post, I shared a PowerShell script that enables you to enable devices to wake up computers. This script relies solely on a WMI interface, but despite the remote nature of WMI, I had provided no method of entering a remote computer name. That changes with the release of my first ever … Read more PowerShell Module: Enable Wake for Devices

PowerShell: Enable wakeup for devices

Introduction Sometimes, if you allow your computers to go to sleep regularly, you may want to ensure that they can be easily woken using their keyboards, mice, or other peripherals. End users can get confused if they are only able to wake their computer by pressing the power button; sometimes this is made even more … Read more PowerShell: Enable wakeup for devices

PowerShell: Finding Currently Loaded DLLs

I was just browsing through the root\cimv2 WMI namespace this morning, using SAPIEN’s free WMI Explorer tool, when I happened across a WMI class called CIM_ProcessExecutable. In fact, what I was doing in a bit more detail, was going through the CIM_* classes, with the Instances tab selected, so I could discover if any of … Read more PowerShell: Finding Currently Loaded DLLs

PowerShell: AD / SCCM Workstation Cleanup Script Version 3.0

I just realized, I still haven’t posted the script that removes SCCM resources, alongside Active Directory cleanup. I had written a version 3.0 of a script I previously posted, but never posted it. So, here it is (I haven’t tested it in a while): Disclaimer: I am not responsible for what you do with this … Read more PowerShell: AD / SCCM Workstation Cleanup Script Version 3.0