Import-DscResource Warning Message in WMF 5.0 April 2015 Preview

The latest version of the Microsoft Windows Management Framework (WMF) Core 5.0 package has some improvements to the PowerShell and Desired State Configuration (DSC) experience. One of those improvements is a warning message that will appear, if you do not use the Import-DscResource dynamic keyword to import the PSDesiredStateConfiguration module. The warning message appears when … Read more Import-DscResource Warning Message in WMF 5.0 April 2015 Preview

Clean up unused Azure VHD Disks

Introduction The Microsoft Azure platform maintains a list of VHD blobs that have been registered as “disks” in your Azure subscription. You can view a list of registered “disks” by opening the Azure Portal, going to the Virtual Machines node, and selecting the Disks link. Each Azure disk has a property called AttachedTo that indicates … Read more Clean up unused Azure VHD Disks

Use PowerShell DSC to Install DSC Resources

IMPORTANT: This post was authored in August 2014, and is out of date. At this point, you should be installing PowerShell DSC resources from the PowerShell Gallery, using the PowerShellGet\Install-Module command.

Introduction

A lot of the functionality provided by Microsoft PowerShell Desired State Configuration (DSC) comes, not from the core product, but from the DSC Resources that are provided by Microsoft and the community. When you spin up a new Windows operating system, whether a physical machine, local virtual machine, or a Microsoft Azure virtual machine, you start out with a pretty barebones set of DSC resources. Those resources are listed here:

  • File
  • Archive
  • Environment
  • Group
  • Log
  • Package
  • Registry
  • Script
  • Service
  • User
  • WindowsFeature
  • WindowsProcess

Unfortunately, most people are going to need more capabilities than what is offered out of the box. To that end, Microsoft has been regularly providing “waves” of DSC resources to manage a variety of different applications. As of this article’s writing, the latest wave of DSC resources from Microsoft was “DSC Wave 6,” published on August 21, 2014. During the remainder of this article, our goal is to make sure that these additional DSC Resources are installed on our systems, in an automated fashion!

Read moreUse PowerShell DSC to Install DSC Resources

PowerShell: Update-Help via Scheduled Task in Group Policy Preferences

Introduction

If you’re like me, you probably like to ensure that all your computers have PowerShell updatable help updated on a regular basis. You can achieve this using a variety of methods, but since Group Policy Preferences are available out of the box using Windows 7 and later, I figured it would be the perfect tool to keep PowerShell help up-to-date! The following guide will show you how to implement a Windows Scheduled Task to update PowerShell version 3.0 help on a regular basis.

The following operating systems include Group Policy Preferences Client Side Extensions (GPP-CSE) out of the box:

  • Windows 7
  • Windows 8
  • Windows Server 2008 R2
  • Windows Server 2012

You can also deploy the Windows Management Framework Core 3.0, and Group Policy Preferences Client Side Extensions to Windows Server 2008 non-R2 systems, however the equivalent client operating system, Windows Vista, does not support WMF 3.0.

Read morePowerShell: Update-Help via Scheduled Task in Group Policy Preferences

PowerShell: Get the Windows Azure Certificate

Microsoft Windows Azure Logo

If you’re automating Windows Azure using Windows PowerShell, one of the first things you’ll probably notice is that you need a management certificate to connect to the Windows Azure subscription that you’re attempting to view or modify. Management certificates are associated to a Windows Azure subscription inside the Management Portal, under the Hosted Services, Storage Accounts … Read more PowerShell: Get the Windows Azure Certificate

Dell Updates Client Configuration Toolkit (CCTK)

Dell has just recently updated the Client Configuration Toolkit (CCTK). CCTK is a well-documented command-line tool that allows IT administrators to manage hardware-level settings via script / batch. It uses a Hardware API (HAPI) driver, which can be dynamically installed at runtime, to make changes to the system’s BIOS / UEFI firmware configuration. Download the … Read more Dell Updates Client Configuration Toolkit (CCTK)

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 more Exporting ConfigMgr Task Sequences

AutoIT: Enumerating all Windows

Here is a short script I wrote using AutoIT, which enumerates all of the windows, to the StdOut stream: ConsoleWrite(“Enumerating windows”) $AllWindows = WinList() ConsoleWrite(“Found ” & UBound($AllWindows) & ” windows”) for $i = 0 to UBound($AllWindows) – 1 ConsoleWrite(@lf & “Name: ” & $AllWindows[$i][0]) ConsoleWrite(@lf & “HWND: ” & $AllWindows[$i][1]) next ConsoleWrite(@lf & “Completed … Read more AutoIT: Enumerating all Windows

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 more Code Snippet: Process Time as Percentage of Total CPU Time

PowerShell: AD Workstation Cleanup Script version 2.0

Update (2010-08-25): I have posted a newer version of this script. A little while ago, I posted a PowerShell script that detects old machine accounts in Active Directory, and disables or deletes them, based on certain ages (in days). I’ve continued work on this script, such that it now logs information to Excel about actions … Read more PowerShell: AD Workstation Cleanup Script version 2.0