I am a member of the PowerShell Cmdlet Working Group. We’ve been looking into this issue and it is an intriguing one. Enough so that I spent some time looking into it and writing up some test code. If you work with WMI/CIM this might be of interest to you. Personally, I never have had…
Category: WMI
Building an Active Directory Watcher with CIM and PowerShell
Last week, Adam Bertram sent out a tweet looking for any PowerShell code to notify the user when a new Active Directory user account had been created. I dug out some very, very old code that used a WMI event subscription to watch Active Directory for such an event. The code I shared was something…
Answering the CIM Directory Challenge
The last Iron Scripter challenge of 2020 was a big one. If you didn’t get a chance to work on it, see what you can come up with then come back to see my approach. As with many of the challenges, the goal isn’t to produce a production-ready PowerShell tool, but rather to push the…
Creating Colorful HTML Disk Reports with PowerShell
I have no idea what possessed me, but the other day I came across an older script that uses PowerShell to create an HTML report showing drive utilization for a group of computers. The utilization is displayed using a color gradient from green to red to provide a visual reference. As I looked at the…
A PowerShell Mystery
The other day I was prepping for my sessions at the upcoming PowerShell + DevOps Global Summit. As I usually do, when I am building demos that will connect to remote machines I often use the local computer as a placeholder. This should always work right? so imagine my surprise when this command gave me…
Are You My Type?
I am always stressing that PowerShell is all about the objects. If you keep this in mind, PowerShell is pretty easy to use. Get a bunch of things, and select the details that you want to see or work with. Out of the box PowerShell gives you some very rich objects to work with from…
Friday Fun: Listing WMI Namespaces
Welcome once again to the end of the week. Hopefully you spent some time in PowerShell. If not, perhaps this tidbit will be intriguing enough to give it a try. I always try to put the “fun” in function and today I have one that will enumerate all the WMI namespaces, but using Get-CimInstance, or…
Get Antivirus Product Status with PowerShell
I expect that most of you with enterprise-wide antivirus installations probably have vendor tools for managing all of your clients. If so, don’t go away just yet. Even though I’m going to demonstrate how to get antivirus product status with PowerShell, the scripting techniques might still be useful. Or you might learn a bit more…
The CIM-ple way with PowerShell and Event Logs
I’m always on the lookout for new ways to do things. Often I’m trying to find a way to create something that is easy to use without requiring a lot of PowerShell scripting. I also like using the final result as teaching aids so even if you don’t need the end product, I hope you’ll…
Memory Reporting with PowerShell
I’ve started a new project and I’m hoping a few of you will give it a spin and let me know how it works for you. I’ve created a PowerShell module called MemoryTools that uses a few WMI classes and performance counters to provide insight into memory utilization and configuration on your servers. The module…
The Power of Custom Properties
The other day fellow PowerShell MVP Adam Bertram published an article about using custom properties with Select-Object. It is a good article in that it gets you thinking about PowerShell in terms of objects and not simple text. But I want to take Adam’s article as a jumping off point and take his ideas a…
What Are You?
Here’s a quick way to tell whether a given machine is real or not: check the Win32_Baseboard class. You can use either Get-WmiObject or Get-CimInstance. Notice the results from a few physical machines. Now see the result when querying a Hyper-V virtual machine: I don’t have any VMware available so I don’t know what kind…
Creating Your Own PowerShell Command
Last week, I posted a PowerShell function that you could use as an accelerator to create your own PowerShell tools. My tool takes command metadata from an existing PowerShell cmdlet and gives you the structure to create your own tool wrapped around what is in essence a proxy function. The advantage, besides saving a lot…
Creating CIM Scripts without Scripting
When Windows 8 and Windows Server 2012 came out, along with PowerShell 3.0, we got our hands on some terrific technology in the form of the CIM cmdlets. Actually, we got much more than people realize. One of the reasons there was a big bump in the number of shipping modules and cmdlets was CDXML….
Get PowerShell Version with WMI
With the release of PowerShell 4.0, it is possible you might end up with a mix of systems in your environment. I know I do because I do a lot of writing, testing and development that requires multiple versions in my test network. Recently I was doing some Group Policy work when I thought about…