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 morePowerShell: AD / SCCM Workstation Cleanup Script Version 3.0

PowerShell: Enable / Disable Wake-on-LAN (in ConfigMgr)

Hello from Houston, Texas everyone! Today I’ve got a PowerShell script that was specially developed for my consulting engagements going forward. When implementing 1E WakeUp at a customer, who is integrating it with ConfigMgr (to wake up machines using Software Distribution and Software Updates assignments), I have found that occasionally, a customer has already enabled … Read morePowerShell: Enable / Disable Wake-on-LAN (in ConfigMgr)

Exporting ConfigMgr Task Sequences

This article will briefly discuss how to export a ConfigMgr OSD task sequence. The SMS_TaskSequencePackage class has a lazy property named Sequence which contains the XML for the task sequence. Because this is a lazy property, we must obtain a reference to each WMI instance using its direct path, before we can open the property’s … Read moreExporting ConfigMgr Task Sequences

List of WMI Privileges

Microsoft has a published list of optional WMI privileges at the following link: http://msdn.microsoft.com/en-us/library/aa392758(VS.85).aspx These privileges are sometimes necessary for enabling certain operations in WMI. For example, if you do not specify the Security privilege when accessing instances of the Win32_NTLogEvent WMI class, you will not be able to view event log entries from the … Read moreList of WMI Privileges

PowerShell: Getting started with WMI Events

Introduction PowerShell version 1 provided good integration with WMI using the Get-WmiObject cmdlet, allowing you to easily retrieve and modify WMI instances, and call WMI methods, but PowerShell v2 has taken it, and many other things, a lot farther. One of those areas is eventing, and not just WMI eventing, but responding to WMI events … Read morePowerShell: Getting started with WMI Events

PowerShell: Disabling Task Sequence ProgramFlags

If you are using Microsoft ConfigMgr 2007, you may be familiar with the ProgramFlags bit that controls the “Allow this program to be installed from the Install Software task sequence without being advertised” setting on a Program configuration. Someone on the MyITforum “mssms” mailing list recently asked how to disable this setting for all SMS programs … Read morePowerShell: Disabling Task Sequence ProgramFlags

Code Snippet: Process Time as Percentage of Total CPU Time

A couple of weeks ago, a colleague of mine asked me how I would determine a process’ CPU utilization as a percentage of total CPU time. I came up with this PowerShell code, but it’s not quite complete yet, because it doesn’t dynamically determine the number of cores that a system has. During the investigation … Read moreCode Snippet: Process Time as Percentage of Total CPU Time

WMI Repository Corruption / SCCM Client Fix

You may have come across the following messages in the execmgr.log file on your SCCM clients: Failed to open to WMI namespace ‘.rootccmPolicyMachine’ (8007045b) Failed to ConnectSettings for ICcmPolicyAgent in CSoftDistPolicyNamespace::ConnectToNamespace Failed to ConnectToNamespace in CSoftDistPolicyNamespace::GetMachinePolicy Failed to connect to machine policy name space. 0x8007045b Failed to connect to user policy name space CSoftwareDistPolicyMgr::GetSWDistSiteSettings failed … Read moreWMI Repository Corruption / SCCM Client Fix

WMI Documentor

Here is a crude, but functional Visual Basic (VB) script that I wrote to document WMI classes, methods, and properties in Microsoft Excel so that they are searchable. Option Explicit dim TargetWmiNs, Excel, Row, tWmiClass, WmiClasses ‘*** Set this variable to the target WMI namespace to document TargetWmiNs = “\\remotecomputer\root\sms\site_lab” ‘*** Create Excel object set … Read moreWMI Documentor