02.26.09

Automating GP Preferences

Posted in Group Policy Preferences at 2:47 pm by Administrator

In a recent posting on the Activedir.org mailing list, I happened to mention that we’re getting ready to release v. 2.0 of our GPExpert(r) Scripting Toolkit. The Toolkit is actually getting a new name, but I won’t spoil the surprise for now. However, the key feature we’ve added to it is support for the new Group Policy Preferences (GPP) settings! This is pretty exciting because this now means that you can use PowerShell or .Net to automate the reading and writing of all of the GP Preference settings across GPOs. And even more exciting is the fact that we are also supporting the ability to do Item-Level Targeting through the Toolkit as well. This means that you can not only define GP Preferences settings but also target them using any of the many different ILT criteria. And if that weren’t exciting enough (I know, I’m easily geeked out!) how about the fact that you can run GPP scripts on XP or Server 2003 in addition to Vista and 2008. That’s right, even though you can’t normally edit GPP settings on anything other than Vista, SP1 or Server 2008, the Toolkit’s GPP support has no such limitation. So you can read and write GPP settings from any platform from XP on up! Double-cool. 

As an example of how this comes in handy, we recently worked on a customer GPO consolidation/migration where they were consolidating a large number of GPOs spread across 3 forests into a single forest. They had not used GPP prior to the new deployment but did have another product in place for delivering drive and printer mappings (Scriptlogic’s Desktop Authority product in this case). We were able to use the new Toolkit with support for GPP to automate the process of converting their dozens of drive and printer mappings into GPP settings within a couple of GPOs. Cool!

Lets look at how you can write a PowerShell script to create a drive mapping policy that targets a particular user group:

=======================================================

#connect to the GPO

$gpo = Get-SDMgpobject -gpoName "gpo://cpandl.com/Marketing Drive Mappings Policy" -openByName

# now, connect to the GPP drive maps container

$driveMapSetting = $gpo.GetObject("User Configuration/Preferences/Windows settings/Drive Maps")

# define a new drive mapping

$map = $driveMapSetting.Settings.AddNew("P Drive")

# and set its properties

$map.Put("Action",[GPOSDK.EAction]"Update")

$map.Put("Drive Letter","P")

$map.Put("Location","\\MktgServer1\public")

$map.put("Reconnect", $true);

$map.Put("Label as", "Marketing Public Drive");

# save it!

$map.Save()

# now create a group-based ILT filter

$iilt = $gpo.CreateILTargetingList()

$itm = $iilt.CreateIILTargeting([GPOSDK.Providers.ILTargetingType]"FilterGroup");

$itm.Put("Group","Marketing Users")

$itm.Put("UserInGroup", $true)

$iilt.Add($itm)

# and apply my new ILT to the drive mapping

$map.put("Item-level targeting", $iilt)

$map.Save()

=======================================================

Pretty cool, huh? Well, I think so :) Now imagine that you can do this across any of the numerous settings within GPP and you’ll see why I’m excited about this new release of the Toolkit! I will be blogging when we get the bits out there. Right now we’re working on a big, thick user guide with a ton of examples of how you can use the Toolkit and PowerShell to automate any number of GP management tasks. Stay tuned….

 

Tags:

Group Policy, PowerShell, Group Policy Preferences, GPExpert Scripting Toolkit, Group Policy Automation

02.12.09

Group Policy Preferences and the Registry

Posted in Group Policy Preferences at 5:31 pm by Administrator

So, the other day I was trading some email with a friend and mentioned that I was working on a nifty little utility to allow someone to import the contents of a .reg file into Group Policy Preferences registry extensions using the command-line. He commented that it sounded interesting but that the GP Preferences UI already supported something like this. So I thought I’d play around with it and see exactly how this works. He was right of course (mostly because he was the original architect of the predecessor of GP Preferences Laughing).

Within the Registry portion of GP Preferences (Computer or User Configuration/Preferences/Windows Settings/Registry), you can, of course, deploy individual registry settings to your heart’s content. I find this to be a better alternative to writing custom ADM or ADMX files in most cases because its easier to do, and you can leverage the Item-level Targeting feature in GPP. But what I hadn’t tried was the Registry Wizard option that you get if you right click the Registry nodes and choose New, Registry Wizard. This is where it gets fun. From this wizard, you can browse the registry on either the local or a remote computer and choose the reg keys and values within the registry tree, that you’d like to deploy, as shown here:

Browsing the Registry in GP Prefs

Once you’ve chosen the keys and values you want, GP Preferences automatically creates the policy settings for those keys and lets you distribute them to all your target machines.

So, my friend was right, of course. I’m still going to build my command-line .reg import tool because, hey, its always better from the command-line, right? But this is a pretty cool capability within GP Preferences that lets you get going right away deploying registry modifications instead of having to write those pesky ADM files.

 

Tags

Group Policy, Group Policy Preferences, ADM

02.04.09

AGPM Planning Guide released

Posted in Microsoft-Related at 2:06 pm by Administrator

Just a quick note for those of you using or thinking about using Microsoft Advanced Group Policy Management (AGPM) product for Group Policy Change Control. MS has just released a planning guide for AGPM here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=5ed2bcd7-214a-4606-8e91-369c3623ee89&DisplayLang=en

AGPM is another by-product of Microsoft’s acquisition of DesktopStandard (formerly known as GPO Vault) and is available as part of the Desktop Optimization Pack (MDOP) for MS Software Assurance customers. Its definitely a cool product and a must-have for shops looking to manage change within their GP environments.

Darren

 

Tags

Group Policy, AGPM