Select Page

The SDM Group Policy Automation Engine provides a PowerShell interface for getting and setting configuration in Group Policy Objects (GPOs). We utilize a single cmdlet called Get-SDMGPObject. This single cmdlet provides all the secret sauce that makes the magic happen. With that said, this cmdlet has some complexities. These are easy to get around– it just takes practice. In the end you can do everything with Get-SDMGPObject itself. The details of that is for another time.

SDM Provides a PowerShell module called SDM-GPAEScript to supplement the GPAE. This module is a bit of a toolkit and was designed to get people started in building their own automation around the GPAE. It also greatly simplifies some tasks and makes them more powershelly (it’s a word, really… why not!). An example of this is simple to articulate. Here are two ways to reference a GPO, the initial task of all GP Automation with GPAE:

  1. Get-SDMgpobject -GpoName “gpo://scico.local/<GPOName>” -OpenByName
  2. Get-GPAEGPO -Displayname “<GPOName>”
So, both do the job. #1 above uses Get-SDMGPObject directly where #2 calls that cmdlet through the code in the Get-GPAEGPO advanced function. All the hard work is done in the function. And it is simply easier to read. The differences in complexity and the benefits of the SDM-GPAEScript become increasingly more clear as you dive deeper into the product. Now, I am not attempting to state that the SDM-GPAEScript module is a complete solution. Think of it as a starting point. You can read the functions and see how they work. You can create your own. Some advanced PowerShell wizardry but super powerful. The example below with Deployed Printers uses a function provided in the SDM-GPAEScript module called Set-GPDeployedPrinter.

Set-GPDeployedPrinter

In the spirit of full disclosure I recorded this 4 times. I found it difficult to talk about it in just a couple of minutes. The reason is that there is a lot to talk about with this product. In the spirit of brevity and to stay focused on the scenario at hand I removed a lot of the background information. This walk through is simple a one-liner that creates a deployed printer in a GPO or allows you to modify and existing printer already in a GPO. Take a look. Let us know what you think.