PowerShell

Powershell related code snippets

PowerShell DSC Encryption

PowerShell’s Desired State Configuration allows for routines or classes to be run on remote machines by passing a text based “properties” object to the destination end-node.  There are a growing number of Microsoft supplied “classes” and importantly, the framework allows for custom development of additional objects.

MOF Files define the inputs to the class that will be run remotely.

Retrieving REST based results from SMA Runbooks

In a previous example, I gave an example of running a simple Service Management Automation runbook using REST.  This blog demonstrates how to retrieve output from a called runbook by using platform independent REST calls against the SMA Server. 

Four steps exist in obtaining the output from an SMA Runbook:   

Creating SCCM Global Conditions by Script

I’ve written a fair bit about automating SCCM application creation by script.  Most of this has originated from the need to use Enhanced Detection Methods for determining when Applications are installed as I know from many years of Application Packaging that unless an official “package” produces a standard file or registry based flag when it’s installed, it becomes impossible to tightly manage a software environment. 

Using XML Lookup Files with Orchestrator

There can be many reasons for needing site specific data related to an IP address.  I had a recent requirement for Orchestrator to configure machines when the only input was the IP Address of the target machine.   This solution uses PowerShell to compare an IP Address to an XML based lookup table of site information.  By finding the right site, other locale details can be used through Orchestrator.  The XML below represents the site information needed by my particular process.