<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PowerShell Magazine</title>
	<atom:link href="http://www.powershellmagazine.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.powershellmagazine.com</link>
	<description>For the most Powerful community</description>
	<lastBuildDate>Mon, 14 May 2012 18:00:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Formatting changes for System Center Operations Manager 2012 in Update Rollup 1</title>
		<link>http://www.powershellmagazine.com/2012/05/14/formatting-changes-for-system-center-operations-manager-2012-in-update-rollup-1/</link>
		<comments>http://www.powershellmagazine.com/2012/05/14/formatting-changes-for-system-center-operations-manager-2012-in-update-rollup-1/#comments</comments>
		<pubDate>Mon, 14 May 2012 18:00:18 +0000</pubDate>
		<dc:creator>Stefan Stranger</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[opsmgr]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scom]]></category>
		<category><![CDATA[system center]]></category>

		<guid isPermaLink="false">http://www.powershellmagazine.com/?p=2431</guid>
		<description><![CDATA[On the 7th of May 2012 we released our first Update Rollup 1 (UR1) for System Center 2012. In addition to earlier released fixes for Virtual Machine Manager (VMM) and... <span class="meta-more"><a href="http://www.powershellmagazine.com/2012/05/14/formatting-changes-for-system-center-operations-manager-2012-in-update-rollup-1/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p>On the 7th of May 2012 we released our first Update Rollup 1 (UR1) for System Center 2012. In addition to earlier released fixes for Virtual Machine Manager (VMM) and App Controller (AC), the update rollup now includes fixes for System Center Operations Manager (OM).</p>
<p>And because I&#8217;m a <a href="http://blogs.technet.com/b/stefan_stranger/">Premier Field Engineer at Microsoft</a> specialized in System Center Operations Manager I was curious to see if some of the suggestions I made in pre-RTM and Beta versions where part of this Update Rollup 1. Let&#8217;s go back some months when I was in Redmond for our semi-annual TechReady. TechReady is  5-day internal technical conference for Microsoft employees. During my time in Redmond for TechReady I was asked to work with <a href="http://twitter.com/jamesbru">James Brundage</a> on some of the suggestions I made for the System Center Operations Manager cmdlets in the pre-RTM and Beta versions of the product. <a href="http://www.microsoft.com/en-us/server-cloud/system-center/default.aspx">System Center Operations Manager 2012</a> is officially released during the Microsoft Management Summit in Las Vegas in April 2012.</p>
<p>When looking at the <a href="http://support.microsoft.com/kb/2686249">Description of Update Rollup 1 for System Center 2012</a> I found the following:</p>
<p><img class="alignnone size-full wp-image-2432" title="scom2012_01" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_01.png" alt="" width="538" height="148" /></p>
<p>Yes! There I found the formatting changes James and I worked on during my week at TechReady. But let&#8217;s explain first some basic information about PowerShell formatting. We start using our beloved Get-Help cmdlet.</p>
<p>Get-Help about*format* will return Help information from the about_Format.ps1xml help file. It tells us that the Format.ps1xml files in Windows PowerShell define the default display of objects in the Windows PowerShell console. You can create your own Format.ps1xml files to change the display of objects or to define default displays for new object types that you create in Windows PowerShell.</p>
<p>And that&#8217;s exactly what James did with the suggestions I made for some of the earlier formatting in the Beta releases of System Center Operations Manager 2012, changing the format.ps1xml files for System Center Operations Manager 2012. How do we know what has changed since the last RTM Release? Just compare the Release to Manufacturing (RTM) formatting files with the new UR1 formatting files.</p>
<p>To find the format.ps1xml files for the Operations Manager 2012 we need to look in the installation where the Operations Manager Console is installed. We can search the program installation folder recursively for the files with the format.ps1xml extension.</p>
<pre>PS&gt; $path = "D:\Program Files\System Center 2012\Operations `
          Manager\Powershell\OperationsManager"
PS&gt; Get-ChildItem -Path $path -Recurse -Filter *.format.ps1xml</pre>
<p>* I&#8217;ve installed Operations Manager on my D: drive, default it&#8217;s installed on your C: drive.</p>
<p><img class="alignnone  wp-image-2435" title="scom2012_02" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_02.png" alt="" width="629" height="254" /></p>
<p>Now we know which files we need to compare with the new installed *.format.ps1xml from the UR1.  We can use the Compare-Object cmdlet to check which files have been changed.</p>
<pre>$PreUR1FilesPath = "D:\Temp\Powershell_preRU1"
$PostUR1FilesPath = "D:\Temp\Powershell_postRU1"
$filter = "*.format.ps1xml"

$PreUR1FormatFiles = Get-ChildItem -Path $PreUR1FilesPath -Recurse -Filter $filter
$PostUR1FormatFiles = Get-ChildItem -Path $PostUR1FilesPath -Recurse -Filter $filter
$result=Compare-Object -ReferenceObject $PreUR1FormatFiles -DifferenceObject `
          $PostUR1FormatFiles -Property Name, Length
$result | Format-Table -AutoSize</pre>
<p>&nbsp;</p>
<p><a href="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_03.png"><img class="alignnone  wp-image-2437" title="scom2012_03" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_03.png" alt="" width="629" height="101" /></a></p>
<p>The only file that seems to be changed is the Microsoft.SystemCenter.OperationsManagerV10.format.ps1xml file.</p>
<p><a href="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_04.png"><img class="alignnone  wp-image-2438" title="scom2012_04" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_04.png" alt="" width="628" height="144" /></a></p>
<p>And again we are using the Compare-Object cmdlet to compare the content of the pre RU1 Microsoft.SystemCenter.OperationsManagerV10.format.ps1xml file with the post RU1 format file.</p>
<pre>$strReference = Get-Content "D:\Temp\Powershell_preRU1\OperationsManager\ `
   OM10.Commands\Microsoft.SystemCenter.OperationsManagerV10.format.ps1xml"
$strDifference = Get-Content "D:\Temp\Powershell_postRU1\OperationsManager\ `
   OM10.Commands\Microsoft.SystemCenter.OperationsManagerV10.format.ps1xml"
Compare-Object -ReferenceObject $strReference -DifferenceObject $strDifference</pre>
<p><a href="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_05.png"><img class="alignnone  wp-image-2439" title="scom2012_05" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_05.png" alt="" width="629" height="391" /></a></p>
<p>We can see all the formatting that has been changed in RU1.  To be honest there are better tools to compare the contents of two files, and I&#8217;ve use Notepad++ to look at one interesting formatting change <img src='http://www.powershellmagazine.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><a href="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_06.png"><img class="alignnone  wp-image-2440" title="scom2012_06" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_06.png" alt="" width="626" height="335" /></a></p>
<p>We can see formatting for the Microsoft.EnterpriseManagement.Administration.NotificationRecipient TypeName did not existed before RU1 was installed. To find the cmdlet(s) which has the Microsoft.EnterpriseManagement.Administration.NotificationRecipient is easy using the Get-Command cmdlet.</p>
<pre>Import-Module OperationsManager
Get-Module
Get-Command -Module OperationsManager |
 Where-OBject {$_.OutputType -like `
  "Microsoft.EnterpriseManagement.Administration.NotificationRecipient"}</pre>
<p><a href="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_07.png"><img class="alignnone  wp-image-2441" title="scom2012_07" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_07.png" alt="" width="629" height="226" /></a></p>
<p>We can now run the Get-SCOMNotificationSubscriber cmdlet from the Operations Manager Shell to see the cool formatting improvements in RU1.</p>
<p><a href="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_08.png"><img class="alignnone  wp-image-2442" title="scom2012_08" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/scom2012_08.png" alt="" width="629" height="209" /></a></p>
<p>This is it for now about the formatting improvements in RU1 for System Center Operations Manager 2012. Maybe next time a blog post about how you can use the <strong> </strong><a href="http://ezout.start-automating.com/"><strong>EzOut module</strong></a> from Start-Automating for simplifying the process of making format XML files. You can use EZOut to change formatting and type information on the fly, or use it to help author files to use with your PowerShell modules.</p>
<p>References:</p>
<ul>
<li><a href="http://www.microsoft.com/en-us/download/details.aspx?id=29697">Update Rollup 1 for System Center 2012 &#8211; Operations Manager</a></li>
<li>Detailed list of fixes can be found on Knowledge Base Article <a href="http://support.microsoft.com/kb/2686249">KB2686249</a></li>
<li>System Center Operations Manager Team blog <a href="http://blogs.technet.com/b/momteam/archive/2012/05/09/update-to-update-rollup-1-for-system-center-2012.aspx">Update to Update Rollup 1 for System Center 2012</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.powershellmagazine.com/2012/05/14/formatting-changes-for-system-center-operations-manager-2012-in-update-rollup-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Managing Group Policy with PowerShell</title>
		<link>http://www.powershellmagazine.com/2012/05/14/managing-group-policy-with-powershell/</link>
		<comments>http://www.powershellmagazine.com/2012/05/14/managing-group-policy-with-powershell/#comments</comments>
		<pubDate>Mon, 14 May 2012 18:00:14 +0000</pubDate>
		<dc:creator>Darren Mar-Elia</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[gpo]]></category>
		<category><![CDATA[group policy]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://www.powershellmagazine.com/?p=2378</guid>
		<description><![CDATA[Overview In this article, I’ll talk about your options when it comes to managing Group Policy using PowerShell. To be sure, depending upon your needs, Group Policy is nearly a... <span class="meta-more"><a href="http://www.powershellmagazine.com/2012/05/14/managing-group-policy-with-powershell/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<h4>Overview</h4>
<p>In this article, I’ll talk about your options when it comes to managing Group Policy using PowerShell. To be sure, depending upon your needs, Group Policy is nearly a full citizen in the world of PowerShell-based management. I’ll talk about why I say, “nearly” a little later, but to review, you have the following options for managing GP with PowerShell today:</p>
<ul>
<li>Windows Server 2008 R2 and Windows 7 introduced the Group Policy PowerShell Module
<ul>
<li>25 cmdlets for managing Group Policy</li>
<li>You can still access the “old” GPMC APIs through COM in PowerShell</li>
<li>My free GPMC cmdlets (introduced originally in 2008) – <a href="http://www.sdmsoftware.com/freeware">www.sdmsoftware.com/freeware</a>
<ul>
<li>Provides a friendly wrapper on the GPMC COM APIs for Windows XP/Server 2003 environments</li>
<li>My free cmdlets for troubleshooting/reporting/managing other aspects of Group Policy with PowerShell <a href="http://www.sdmsoftware.com/freeware">http://www.sdmsoftware.com/freeware</a> &amp; <a href="http://www.gpoguy.com/Free-GPOGuy-Tools.aspx">http://www.gpoguy.com/Free-GPOGuy-Tools.aspx</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Let’s start off by talking about the Group Policy Module that Microsoft shipped in Windows 7 &amp; Windows Server 2008 R2.</p>
<h4>The Group Policy PowerShell Module</h4>
<p>With the release of Windows 7 and Windows Server 2008 R2, Microsoft shipped the Group Policy Module—a set of 25 PowerShell cmdlets that it made available for GPO administrators to manage many of the same tasks that they would perform using GPMC. In fact, the GP PowerShell module is automatically installed when GPMC is installed as part of the Remote Server Administration Tools (RSAT) installation, as shown in Figure 1 below:</p>
<p><img class="alignnone size-full wp-image-2381" title="darren1" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/darren1.png" alt="" width="463" height="457" /><br />
Figure 1: Installing the GPMC and associated PowerShell Module</p>
<p>Once GPMC is installed, you can load up the Group Policy module simply by opening a PowerShell console session and typing:</p>
<pre> PS&gt; Import-Module GroupPolicy</pre>
<p>To get a list of cmdlets available in the module, simply type:</p>
<pre> PS&gt; Get-Command –Module GroupPolicy</pre>
<p>The Group Policy module covers the following tasks that you would typically perform within the GPMC GUI:</p>
<ul>
<li>Creating/Deleting/Renaming/Getting GPOs</li>
<li>Backup/Restore/Copy/Import GPOs</li>
<li>Creating/Getting Starter GPOs</li>
<li>Getting/Setting GP Inheritance</li>
<li>Getting/Setting GPO Permissions</li>
<li>Creating/Deleting/Modifying GPO Links</li>
<li>Get GPO Settings and RSoP Reports</li>
<li>Getting/Setting/Deleting Administrative Template Settings</li>
<li>Getting/Setting/Deleting GP Preferences Registry Policy</li>
</ul>
<p>Of course, there are things you <span style="text-decoration: underline;">can’t</span><strong> </strong>do with the Group Policy module, such as:</p>
<ul>
<li>Can’t get GPO links by SOM or GPO*</li>
<li>Can’t set WMI filters, except by GPO (and then only Gets are supported)</li>
<li>Can’t write Deny ACEs onto GPO permissions</li>
<li>Can’t write SOM delegation (e.g. Linking/RSOP/Planning permissions)*</li>
<li>Can’t read list of existing GPMC GPO Backups*</li>
</ul>
<ul>
<li>Can’t read/write GPOs setting outside of Administrative Templates or GP Preferences Registry Policy*</li>
</ul>
<p>The items listed above with * are functions that you CAN do with a combination of SDM Software’s GPMC cmdlets (more on this later) or the commercial <a href="http://www.sdmsoftware.com/products/group-policy-automation-engine/" target="_blank">Group Policy Automation Engine</a>.</p>
<h4>Using the GP Module</h4>
<p>Despite the limitations in the Microsoft Group Policy, there is still quite a bit you can do with it. For example, the following PowerShell one-liner creates a new GPO, set an Administrative Template policy item, then changes delegation on the GPO to control who processes it, and finally links it to an OU:</p>
<pre>$key = HKLM\Software\Policies\Microsoft\Internet Explorer\Restrictions'
New-GPO 'IE No Help Policy' | Set-GPRegistryValue -Key $key `
-ValueName 'NoHelpMenu' -Type DWORD -Value 1 | Set-GPPermissions -Replace `
-PermissionLevel None -TargetName 'Authenticated Users' -TargetType group | `
Set-GPPermissions -PermissionLevel gpoapply -TargetName 'Marketing Users' `
-TargetType group | New-GPLink -Target 'OU=Marketing,DC=cpandl,DC=com' –Order 1</pre>
<p>Let’s walk through what this one-liner is doing. The first cmdlet call is to <strong>New-GPO</strong>, where we create a GPO called “IE No Help Policy”. The next cmdlet, called <strong>Set-GPRegistryValue</strong>, is the one that sets an Administrative Template policy value within my newly created GPO. You’ll notice that the parameters on this cmdlet set the underlying registry value of the Admin. Template policy in question, rather than a “friendly” path as you would see in GP editor. This is by design. In order to use this cmdlet, you’ll need to know the underlying Registry key, value and value type for a particular Admin . Template policy before you can set it using this policy. In other words, the registry key and value I used above, HKLM\Software\Policies\Microsoft\Internet Explorer\Restrictions \NoHelpMenu corresponds to a path under Administrative Templates in GP Editor – specifically Computer Configuration\Policies\Administrative Templates\Windows Components\Internet Explorer\Turn off displaying the Internet Explorer Help Menu and I had to determine that by looking at the underlying ADMX file to see which registry location set that policy.</p>
<p>After we set the Registry policy item, we call <strong>Set-GPPermissions</strong> to remove the Authenticated Users ACE from the GPO’s security delegation. This is the default ACE that gets applied to a GPO that allows all users and computers to process that GPO. In our example above, we want this GPO to only be processed by members of the “Marketing Users” group. As a result, we pipe to the next Set-GPPermissions call to add the Marketing Users Group with the Apply Group Policy (gpoapply) permission to grant that access.</p>
<p>Finally, we link the new GPO using <strong>New-GPLink</strong> to the Marketing OU within the cpandl.com domain, and we’re done! We now have a fully functional, fully permissioned, and linked GPO.</p>
<h4>Getting Around Get-GPO</h4>
<p>One of the most useful cmdlets in the Group Policy module is the <strong>Get-GPO</strong> cmdlet. This is the cmdlet you’ll use to get information about individual GPOs. You can also pass it the <strong>–All</strong> parameter to get back information on all GPOs within a given domain, as shown in <strong>Figure 2</strong> below:</p>
<p><img class="alignnone  wp-image-2383" title="darren2" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/darren2.png" alt="" width="598" height="385" /><br />
Figure 2: Viewing the output of Get-GPO –All</p>
<p>As you can see from Figure 2, Get-GPO returns a set of properties related to the GPO in question. These range from the GPO’s name, GUID (Id property), Description (comment) and GPO status, to its version information and whether it has any WMI filters linked to it. If you get a GPO and pipe that to Get-Member, you’ll also see a wide variety of methods available to this cmdlet, as shown in <strong>Figure 3</strong> below:</p>
<p><img class="alignnone  wp-image-2385" title="darren3" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/darren3.png" alt="" width="598" height="313" /><br />
Figure 3: Getting the members of Get-GPO</p>
<p>What’s interesting about this is that many of the methods shown in Figure 3 above are wrapped up in other cmdlets with the Group Policy Module. For example, the Backup method, which could be called directly here, is exposed via the <strong>Backup-GPO</strong> cmdlet. But there are some methods that are not exposed through cmdlets, such as IsAclConsistent() and MakeAclConsistent(), which actually check whether the given GPO’s ACLs are consistent between the AD and SYSVOL parts of the GPO and, if not, will fix it.</p>
<p>In addition, we can use this Get-GPO cmdlet to get information about WMI filters that are linked to a GPO. For example, I can view a WMI filter linked to a GPO as follows:</p>
<pre>(Get-GPO 'WMI Filter Test').WmiFilter</pre>
<p>The output of this, as an example, is shown here:</p>
<pre>(Get-GPO 'wmi filter test').WmiFilter | Format-List</pre>
<p>Description : This returns a True if the timezone is Pacific</p>
<pre>Name: Timezone
Path: MSFT_SomFilter.ID="{A1B22257-AF6E-4635-99B0-56AF0CC05E44}",Domain="cpandl.com"</pre>
<p>You can also get details about this WMI filter, such as the query it implements, by issuing the following modification to the command above:</p>
<pre>(Get-GPO 'wmi filter test').WmiFilter.GetQueryList()</pre>
<p>Which returns the following:</p>
<pre>root\CIMv2;Select * from Win32_SystemTimeZone Where DaylightName="Pacific Daylight Time"</pre>
<h4>Returning GPO Reports</h4>
<p>The last area I’ll focus on around the Group Policy module are some of the reporting capabilities that are provided—specifically the <strong>Get-GPOReport </strong>cmdlet for returning information about GPO settings and <strong>Get-GPResultantSetOfPolicy</strong> report for returning RSoP data against a given client.</p>
<p>Get-GPOReport is designed to mimic the detail you get when you click on a GPO’s settings tab within GPMC. In fact, you can output the results of this cmdlet to either HTML or XML, where the HTML mimics precisely what you see within GPMC and the XML returns a stripped down representation of settings data, without the labels that identify the settings within GP Editor. Creating a GPO settings report is as simple as typing the following PowerShell command:</p>
<pre>Get-GPOReport 'Default Domain Policy' -ReportType html -Path c:\data\ddreport.html</pre>
<p>In this example, I’ve created an HTML file of the Default Domain Policy GPO and stored it in a file called c:\data\ddreport.html. If I left out the –Path parameter, the raw HTML would be sent to the pipeline. Similarly, if I set the -ReportType parameter to XML, and leave off the path file, I can get the raw XML sent to the pipeline.</p>
<p>This provides some interesting options for getting at this XML data using PowerShell’s [xml] type accelerator. For example, I can issue the following command:</p>
<pre>[xml]$report = Get-GPOReport 'Default Domain Policy' -ReportType xml</pre>
<p>Once you have the report in XML format, you can navigate the XML’s nodes using standard PowerShell properties, as shown here:</p>
<p><img class="alignnone  wp-image-2387" title="darren4" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/darren4.png" alt="" width="598" height="335" /><br />
Figure 4: Navigating a GPO Settings report with XML</p>
<p>You’ll find the actual settings within the report under the Computer and User properties, organized by client side extension (e.g. in Figure 4 above where the Security and Registry extensions are shown under the ExtensionData property).</p>
<p>Similarly, you can get RSoP data for a given computer and user by calling the Get-GPResultantSetOfPolicy cmdlet as follows:</p>
<pre>Get-GPResultantSetOfPolicy -ReportType xml -Computer ‘win7-x86-1’ `
    -User ‘cpandl\darren’ -Path c:\data\rsop.xml</pre>
<p>In this command, I’m calling the cmdlet to get RSoP data from a computer called win7-x86-1 and a user account on that computer called “cpandl\darren”. I store that data an XMLl file called c:\data\rsop.xml. Unlike the Get-GPOReport cmdlet, this RSoP cmdlet doesn’t allow you to leave out the –Path parameter and send the output to the pipeline, curiously. So if you want to load up your XML into a type-accelerated PowerShell variable like I did with Get-GPOReport, you’ll have to first save it to a file then load up that file into a variable as so:</p>
<pre>[xml]$rsop = Get-Content c:\data\rsop.xml</pre>
<p>Then you can navigate the XML nodes just as in my previous example.</p>
<h4>Living Outside the GP Module</h4>
<p>There’s a lot of cool stuff you can do with the GP module, but there are also a fair number of limitations or things that it doesn’t do. To fill in the gaps, those of us at <a href="http://www.sdmsoftware.com/">SDM Software</a> and <a href="http://www.gpoguy.com/">GPOGUY.COM</a> have created a number of PowerShell-based GP utilities to help augment your toolkit, including:</p>
<ul>
<li>At <a href="http://www.sdmsoftware.com/freeware">www.sdmsoftware.com/freeware</a>:</li>
<ul>
<li><span style="text-decoration: underline;">GPMC Cmdlets 1.4</span>: Provides 25 cmdlets for pre-Windows 7/Windows Server 2008 R2 environments. Also includes some things that the GP Module does not—the ability to view GP links by GPO or SOM</li>
<li><span style="text-decoration: underline;">GP Refresh Cmdlet</span>: Let’s you perform remote GP refreshes from PowerShell</li>
<li><span style="text-decoration: underline;">GP Health Cmdlet</span>: Let’s you get GP processing health (including overall status, how long GP processing took, which GPOs were processed, etc.) from PowerShell</li>
</ul>
<li>At <a href="http://gpoguy.com/">GPOGUY.COM</a> (Under the Free Tools Library)</li>
<ul>
<li><span style="text-decoration: underline;">Get-SDMGPOVersion</span> is like a PowerShell version of GPOTool—it checks AD &amp; SYSVOL version number consistency across all GPOs</li>
<li><span style="text-decoration: underline;">Invoke-SDMTouchGPO</span> provides a way of “touching” the version number on a GPO, thereby forcing clients to think it’s changed and perform a refresh of Group Policy</li>
</ul>
</ul>
<p>Our GPMC Cmdlets precede the existence of the Microsoft Group Policy module and provide GPMC functionality to PowerShell for versions of Windows prior to Windows 7 (e.g. Windows XP and Server 2003). You can also still use them under Windows 7, but many of the features are redundant to the Windows 7 GP module. However, as I mentioned above, there are some things you can do with our GPMC cmdlets that aren’t exposed by the GP module, including, most notably, getting information about GPO links. As an example, the <strong>Get-SDMGPLink</strong> cmdlet lets you report on GPO links, but more importantly, you can query GPO links by either scope (e.g. OU or domain) or GPO. For example, if I want to discover all the GPOs linked to the marketing OU, I can issue the following:</p>
<pre>Get-SDMGPLink -Scope 'OU=Marketing,DC=cpandl,DC=com'</pre>
<p>And the cmdlet will report all the GPOs linked to the Marketing OU, as shown in <strong>Figure 5:</strong></p>
<p><img class="alignnone  wp-image-2389" title="darren5" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/darren5.png" alt="" width="598" height="335" /><br />
Figure 5: Viewing GPO links by OU using Get-SDMGPLink</p>
<p>You can also view where a particular GPO is linked by issuing the following command:</p>
<pre>Get-SDMGPLink -Name 'Default Domain Policy'</pre>
<pre></pre>
<h4>Group Policy Troubleshooting</h4>
<p>Next up is the Group Policy health cmdlet, another one of the free cmdlets available at <a href="http://www.sdmsoftware.com/freeware">www.sdmsoftware.com/freeware</a>. The health cmdlet is designed to quickly return GP health and processing information against one or more remote systems. It returns a red or green status about overall GP processing health and provides a lot more detail about the GPOs that were processed by a computer and user, what CSEs were processed and whether they succeeded or failed and other details such as whether loopback was enabled on the system, how long GP processing took and more. Once installed the cmdlet syntax is pretty straightforward—you can pass in a single computer name or a whole OU worth of computers and cmdlet will query the systems and return results to the pipeline. In addition, if you use the OutputbyXML parameter, the results will be returned as an XML document, which you can then store and navigate using PowerShell’s XML node navigation capabilities. An example of the output of the Health cmdlet is shown here: <img class="alignnone  wp-image-2391" title="darren6" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/darren6.png" alt="" width="541" height="230" /> Figure 6: Viewing the output of the Group Policy Health cmdlet</p>
<h4>Commercial Group Policy PowerShell Functionality</h4>
<p>In this final section, I’ll detail the capabilities that you can get for managing GP using commercial solutions developed by <strong>SDM Software</strong>.  The first and most powerful of these is the <a href="http://www.sdmsoftware.com/products/group-policy-automation-engine/"><strong>Group Policy Automation Engine</strong></a><strong>. </strong>The GPAE, first released in 2007, is the first and only product that provides the ability to automate read and writes to GPO settings, using PowerShell, of course. The GPAE supports about 80% of the existing policy areas, including Admin. Templates, Security policy, GP Preferences, Software Installation, Folder Redirection, and more. As a quick example, the following script lets you create new GP Preferences drive mapping policies based on input from a CSV file, complete with an item-level target that filters the drive mapping on a user group:</p>
<pre>function Map-Drive
{
  param(
    [string]$DriveLetter,
    [string]$Share,
    [string]$Domain,
    [string]$GroupName
  )

  Write-Host "Writing Drive Mapping: $DriveLetter"
  $gpo = Get-SDMGPObject "gpo://cpandl.com/Drive Mapping Policy" -OpenbyName
  $path ='User Configuration/Preferences/Windows Settings/Drive Maps'
  $drives = $gpo.GetObject($path)</pre>
<pre>  $map = $drives.Settings.AddNew($DriveLetter)
  $map.Put('Action',[GPOSDK.EAction]'Create')
  $map.Put('Drive Letter',$DriveLetter)
  $map.Put('Location',$Share)
  $map.put('Reconnect', $true)
  $map.Put('Label as', $DriveLetter)

  # now do ILT
  $objUser = New-Object System.Security.Principal.NTAccount $Domain, $GroupName
  $strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
  $iilt = $GPO.CreateILTargetingList()
  $itm = $iilt.CreateIILTargeting([GPOSDK.Providers.ILTargetingType]'FilterGroup')
  $itm.put('Group',$groupName)
  $itm.put('UserInGroup',$true)
  $itm.put('SID',$strSID.Value)
  $iilt.Add($itm)

  # now add ILT to drive mapping and save the setting
  $map.Put('Item-level targeting',$iilt)
  $map.Save()
}

$driveInfo = Import-Csv -Path c:\data\drivemaps.csv
foreach ($drive in $driveInfo)
{
  Map-Drive -DriveLetter $drive.DriveLetter -Share $drive.Share `
            -Domain $drive.Domain -GroupName $drive.GroupName
}</pre>
<p>The GPAE can also read settings out of GPOs and then use that information as input to perform other changes (e.g. reading settings out of one GPO and writing them to another one).</p>
<h4>Exporting and Comparing GPOs the PowerShell Way</h4>
<p>To round out the commercial offering that SDM Software provides, the <a href="http://www.sdmsoftware.com/products/group-policy-reporting-pak/">GPO Reporting Pak</a> are GUI offerings that provide powerful reporting and comparison for GPOs. The Reporting Pak, composed of <strong>GPO Compare </strong>and <strong>GPO Exporter</strong> also provide PowerShell interfaces, so you can do cool stuff like use PowerShell to compare the settings of a GPO in one domain with a GPO in another, as shown in Figure 7.</p>
<p><img class="alignnone  wp-image-2392" title="darren7" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/darren7.png" alt="" width="598" height="406" /><br />
Figure 7: Comparing two GPOs from different domains</p>
<h4>Summary</h4>
<p>The bottom line is that regardless of whether you’re using the Microsoft Group Policy module, some of the free cmdlets available on SDM Software or GPOGUY.COM, or one of the commercial products listed here, there is now little that you can’t do with PowerShell and Group Policy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.powershellmagazine.com/2012/05/14/managing-group-policy-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell Detective</title>
		<link>http://www.powershellmagazine.com/2012/05/10/powershell-detective/</link>
		<comments>http://www.powershellmagazine.com/2012/05/10/powershell-detective/#comments</comments>
		<pubDate>Thu, 10 May 2012 18:00:45 +0000</pubDate>
		<dc:creator>Bartek Bielawski</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[detective]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[trace]]></category>

		<guid isPermaLink="false">http://www.powershellmagazine.com/?p=2323</guid>
		<description><![CDATA[I guess when you use PowerShell; you very often don’t care how it works. As long as it does what you asked it to do – you are happy. Your... <span class="meta-more"><a href="http://www.powershellmagazine.com/2012/05/10/powershell-detective/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p>I guess when you use PowerShell; you very often don’t care how it works. As long as it does what you asked it to do – you are happy. Your job is done on time in consistent, repetitive manner, and you have time to spend with family and friends. But at times you may start to wonder, how it works? When you ask this question, neither –Verbose nor –Debug can answer. It’s either unexpected behaviour of cmdlet, or some magic that happens regardless what documentation clearly states. The part of you which likes riddles, and likes them solved, kicks in. And you begin to dig into the environment. And, of course – you can hire Google-fu, but at times it won’t get you far.</p>
<p>When that happens, it’s the good moment to start PowerShell and take a closer look at two cmdlets: Get-TraceSource and Trace-Command.</p>
<h4>Form a question</h4>
<p>In order to get the right answer – you first need to be sure you asked the question right. That’s why Get-TraceSource is very important part of this puzzle. When you launch it without any parameters you will get the list of possible trace names. Each name is accompanied by description that can be helpful at times, but not always. This cmdlet itself lets you look for particular names using wildcards. Let’s say you want to look deeper into the way parameters are bound by commands. It would be as simple as:</p>
<pre>PS&gt; Get-TraceSource -Name *param*</pre>
<p>One thing to keep in mind: some sources are loaded <strong>after</strong> command is used. For example, try to find any Native* sources before running any native command (like ping, ipconfig, etc):</p>
<p><a href="http://www.powershellmagazine.com/wp-content/uploads/2012/05/PSDetective1.png"><img title="PSDetective1" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/PSDetective1.png" alt="" width="614" height="119" /></a></p>
<p>If -Name is not enough then &#8212; as usually in PowerShell – resulting output of Get-TraceSource can be easily filtered. Just ask for trace source where description matches pattern you are after. And because not all names are very descriptive, or rather – some descriptions are more informative than just $_.Name.Split() – it should help you get to correct source names.</p>
<p>Once you find out what the possible trace name is (you can pick up few, Trace-Command accepts both arrays and wildcards) next step is to actually ask your question and see if this really gives you an answers or just generates several new questions instead.</p>
<h4>Ask your question</h4>
<p>When you got that far you are probably tempted to ask as general question as possible. But you should be careful – Trace-Command can be so verbose in its output, that it can kill your console at times. Also, specifying &#8216;*’ as the name of the trace will seldom be a good idea.</p>
<p>This is moment where two “gotchas” may stop you for a moment or two. First of all – PowerShell is very bad if you specify wrong source name. You won’t get error, warning, suggestion to check valid sources – instead you will get no trace messages at all. If you are confident those messages should show up, you will probably notice a typo eventually. If you are not so sure – you may assume that you just guessed wrong source and look for another ‘suspect’.</p>
<p>Next thing is <a href="http://msdn.microsoft.com/en-us/library/4y5y10s7.aspx">listener</a> that will be target of you trace. If you want to actually see anything you have to either enable –PSHost switch, or select –FilePath. If you haven’t, nothing will show up. Once you got both right – you will get some output that may (or may not) give you clue on what is actually going on:</p>
<p><a href="http://www.powershellmagazine.com/wp-content/uploads/2012/05/PSDetective2.png"><img title="PSDetective2" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/PSDetective2.png" alt="" width="615" height="116" /></a></p>
<p>If the output is just too much to read on the screen – it’s worth considering use of –FilePath instead of –PSHost. And if you want to inject previously run command into –Expression, just use #&lt;pattern&gt;[TAB] – it will get you there promptly.</p>
<p>But, honestly, do you really want to do all that? Copy and paste trace names ‘just in case’? Remember to include listener? And last but not least, inject code using some tricks each time instead of putting it in curly braces and just pass it to tracing command using pipe? Or maybe you do not care about command output now that you have seen it already?</p>
<p>So, why not build simple wrapper that would prevent us from doing all that?</p>
<h4>Questions generator</h4>
<p>I’ve decided long ago to do exactly that: create simple wrapper around Trace-Command that would:</p>
<ul>
<li>validate ‘Name’ parameter using Get-TraceSource</li>
<li>use either PSHost or FilePath (if it’s specified)</li>
<li>sent output to $null if –Quiet option is selected</li>
<li>pick up expression from pipeline, to support easy injection of previously run commands</li>
</ul>
<p>I also decided that I’m fine with chopping off some other options that I hardly use (but it should not be hard to implement them later) like listener options. No more silence when you specify wrong name and no more silence when you forget to select listener. Also, pure traces without some commands output mixed here and there. So here you go, early beta of PowerShell Detective module. <img src='http://www.powershellmagazine.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre>function Trace-Expression {
  [CmdletBinding(DefaultParameterSetName = 'Host')]

  param (
    # ScriptBlock that will be traced.
    [Parameter(
        ValueFromPipeline = $true,
        Mandatory = $true,
        HelpMessage = 'Expression to be traced'
    )]
    [ScriptBlock]$Expression,

    # Name of the Trace Source(s) to be traced.
    [Parameter(
        Mandatory = $true,
        HelpMessage = 'Name of trace, see Get-TraceSource for valid values'
    )]
    [ValidateScript({
        Get-TraceSource -Name $_ -ErrorAction Stop
    })]
    [string[]]$Name,

    # Option to leave only trace information
    # without actual expression results.
    [switch]$Quiet,

    # Path to file. If specified - trace will be sent to file instead of host.
    [Parameter(ParameterSetName = 'File')]
    [ValidateScript({
        Test-Path $_ -IsValid
    })]
    [string]$FilePath
  )

  begin {
    if ($FilePath) {
        # assume we want to overwrite trace file
        $PSBoundParameters.Force = $true
    } else {
        $PSBoundParameters.PSHost = $true
    }
    if ($Quiet) {
        $Out = Get-Command Out-Null
        $PSBoundParameters.Remove('Quiet') | Out-Null
    } else {
        $Out = Get-Command Out-Default
    }
  }

  process {
    Trace-Command @PSBoundParameters | &amp; $Out
  }
}

PS&gt; New-Alias -Name tre -Value Trace-Expression
PS&gt; Export-ModuleMember -Function * -Alias *</pre>
<h4></h4>
<h4>Answer found</h4>
<p>I like to know what is going on behind the scenes. That’s why I use Trace-Command quite often. It helped me very much in the past when I had problem with understanding how Foreach-Object works. What was the issue?</p>
<p>Well, I had no idea why …</p>
<pre>PS&gt; 1..5 | ForEach-Object { 'begin' } { "process: $_" } { 'end' }</pre>
<p>… works and why both –Begin and –End parameters are positional. PowerShell help will tell you that this is not the case. If you use Trace-Expression, you will soon find out that documentation is right, but is not precise in describing how cmdlet as a whole works. It misses very important piece: parameter –Process will take ValueFromRemainingArguments (same way $args does in functions without param block) and if there are more than one – it will try to distribute them between begin, process and end block. First part can be easy traced:</p>
<p><a href="http://www.powershellmagazine.com/wp-content/uploads/2012/05/PSDetective3.png"><img title="PSDetective3" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/PSDetective3.png" alt="" width="605" height="70" /></a></p>
<p>I was not able to find second part (distribution of script blocks) with Trace. But you can guess what is going on because you can get the same result if you make sure all script blocks will be passed to -Process parameter:</p>
<pre>PS&gt; 1..5 | ForEach-Object -Process { 'begin' }, { "process: $_" }, { 'end' }</pre>
<p>I blogged <a href="http://becomelotr.wordpress.com/2011/05/22/magic-of-foreach-object/">about this</a> but found the answer in Bruce Payette’s PowerShell in Action few weeks later. But that incident made me confident that if there are some PowerShell behaviours I don’t understand immediately, then using *Trace* command may provide an explanation. It helped me when I was trying to find out why function that had no Get-Process command in it was complaining about wrong syntax used with this cmdlet.</p>
<p>Let’s reproduce this issue first:</p>
<pre>function Get-Foo {
   param (
    [Parameter(ValueFromPipeline = $true)]
    [string]$Bar
  )

  $Foo = 2

  process {
    $Bar
  }
}</pre>
<p>More experienced users will probably spot an issue immediately in this code, but real example was more complex than this one. What will happen if we use it?</p>
<p><a href="http://www.powershellmagazine.com/wp-content/uploads/2012/05/PSDetective4.png"><img class="alignnone size-full wp-image-2331" title="PSDetective4" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/PSDetective4.png" alt="" width="603" height="144" /></a></p>
<p>This was starting point. Obviously, you won’t find any Get-Process in my code, so where did this error come from? At first, I’ve traced everything to understand why it works like that. Eventually I found root cause of this behaviour.</p>
<p>This is combination of two things: how keywords behave depending on the context and what PowerShell does if a given command doesn’t exist. PowerShell keywords are context-aware. That makes things like ‘foreach’ alias possible, but here, it complicates things. Because ‘process’ is used in the wrong context it’s no longer a keyword, PowerShell will assume its command:</p>
<p><a href="http://www.powershellmagazine.com/wp-content/uploads/2012/05/PSDetective5.png"><img class="alignnone size-full wp-image-2332" title="PSDetective5" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/PSDetective5.png" alt="" width="612" height="100" /></a></p>
<p>But, how did we get an error from <strong>Get-</strong>Process? We won’t find alias or any other command named ‘process’ with Get-Command. That’s another feature that in this scenario becomes an issue:</p>
<p><a href="http://www.powershellmagazine.com/wp-content/uploads/2012/05/PSDetective6.png"><img class="alignnone size-full wp-image-2333" title="PSDetective6" src="http://www.powershellmagazine.com/wp-content/uploads/2012/05/PSDetective6.png" alt="" width="615" height="60" /></a></p>
<p>So not only our keyword was behaving like a command, it was also prepended with get- to make our life easier, something that makes things like ‘date’ instead of ‘Get-Date’ possible.</p>
<p>So remember, whether it’s binding of arguments, ETS, converting types – whatever seems suspicious at first may become obvious once you employ detective inside you, together with two tools that no PowerShell detective can live without: Trace-Command and Get-TraceSource.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.powershellmagazine.com/2012/05/10/powershell-detective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows PowerShell 3.0 Step by Step</title>
		<link>http://www.powershellmagazine.com/2012/05/10/windows-powershell-3-0-step-by-step/</link>
		<comments>http://www.powershellmagazine.com/2012/05/10/windows-powershell-3-0-step-by-step/#comments</comments>
		<pubDate>Thu, 10 May 2012 06:50:51 +0000</pubDate>
		<dc:creator>Shay Levy</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://www.powershellmagazine.com/?p=2418</guid>
		<description><![CDATA[The book, by Ed Wilson, the Microsoft Scripting Guy, is available for pre-order (45% off) on Amazon.]]></description>
			<content:encoded><![CDATA[<p>The book, by Ed Wilson, the <a href=" http://www.scriptingguys.com">Microsoft Scripting Guy</a>, is available for pre-order (45% off) on <a href="http://www.amazon.com/Windows-PowerShell-3-0-Step/dp/0735663394/ref=tsm_1_tp_un_it">Amazon</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.powershellmagazine.com/2012/05/10/windows-powershell-3-0-step-by-step/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interview with Darren Mar-Elia from MMS 2012</title>
		<link>http://www.powershellmagazine.com/2012/05/09/interview-with-darren-mar-elia-from-mms-2012/</link>
		<comments>http://www.powershellmagazine.com/2012/05/09/interview-with-darren-mar-elia-from-mms-2012/#comments</comments>
		<pubDate>Wed, 09 May 2012 14:30:04 +0000</pubDate>
		<dc:creator>Ravikanth</dc:creator>
				<category><![CDATA[Interviews]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[Darren Mar-Elia]]></category>
		<category><![CDATA[gpo]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[MMS]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.powershellmagazine.com/?p=2410</guid>
		<description><![CDATA[Editor Aleksandar Nikolic caught up with Darren Mar-Elia, the CTO and founder of SDM Software &#38; GPOGUY.com, at MMS 2012. Darren has been a Microsoft MVP in Group Policy technology... <span class="meta-more"><a href="http://www.powershellmagazine.com/2012/05/09/interview-with-darren-mar-elia-from-mms-2012/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p>Editor Aleksandar Nikolic caught up with Darren Mar-Elia, the CTO and founder of SDM Software &amp; <a href="GPOGUY.com">GPOGUY.com</a>, at <a href="http://www.mms-2012.com/">MMS 2012</a>. Darren has been a Microsoft MVP in Group Policy technology for the last 8 years, and has written and spoken on Active Directory, Group Policy and PowerShell topics around the world. You&#8217;ll hear Darren talking about managing Group policy with PowerShell and how his PowerShell-based products have filled in a gap left even after Microsoft introduced Group Policy module with Windows Server 2008 R2. He&#8217;s talked briefly about his Group Policy-related session at MMS 2012 and announced &#8220;Best Practices for Designing and Consolidating Group Policy for Performance and Security&#8221; (<a href="http://northamerica.msteched.com/topic/details/2012/WSV206#fbid=qtp3Ihr8FLm">http://northamerica.msteched.com/topic/details/2012/WSV206#fbid=qtp3Ihr8FLm</a>) session that he&#8217;s preparing for TechEd NA in Orlando.</p>
<p style="text-align: center;"><iframe src="http://www.youtube.com/embed/mnsI0Tx0pOY" frameborder="0" width="480" height="360"></iframe></p>
<p>Links of interests:</p>
<p><a href="http://www.sdmsoftware.com/">http://www.sdmsoftware.com/<br />
</a><a href="http://gpoguy.com/">http://gpoguy.com/<br />
</a><a href="http://twitter.com/grouppolicyguy">http://twitter.com/grouppolicyguy</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.powershellmagazine.com/2012/05/09/interview-with-darren-mar-elia-from-mms-2012/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Day 3 From the PowerShell Deep Dive at TEC 2012</title>
		<link>http://www.powershellmagazine.com/2012/05/05/day-3-from-the-powershell-deep-dive-at-tec-2012/</link>
		<comments>http://www.powershellmagazine.com/2012/05/05/day-3-from-the-powershell-deep-dive-at-tec-2012/#comments</comments>
		<pubDate>Sat, 05 May 2012 12:25:54 +0000</pubDate>
		<dc:creator>Steven Murawski</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Deep Dive]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[TEC2012]]></category>

		<guid isPermaLink="false">http://www.powershellmagazine.com/?p=2350</guid>
		<description><![CDATA[On the third and final day of the PowerShell Deep Dive, the great content continued to roll. The morning started with a bang when Richard Siddaway opened up with an overview... <span class="meta-more"><a href="http://www.powershellmagazine.com/2012/05/05/day-3-from-the-powershell-deep-dive-at-tec-2012/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p>On the third and final day of the PowerShell Deep Dive, the great content continued to roll.</p>
<p>The morning started with a bang when <a href="http://richardspowershellblog.wordpress.com/">Richard Siddaway</a> opened up with an overview of CDXML and how, using an XML configuration file, one can generate cmdlets from a WMI interface.  Kenneth Hansen, from the PowerShell team, made sure that our minds were sufficiently churning with ideas for using this new feature before sharing that CDXML was not limited to WMI, but that there is an API that allows CDXML to target almost any other source!  The face of unified management is changing, and we get to watch it unfold.</p>
<p>Our own <a title="Follow Aleksandar on Twitter" href="http://twitter.com/alexandair" target="_blank">Aleksandar Nikolic</a> covered how to build a constrained endpoint in PowerShell V3.  One off the challenges to the new constrained endpoints is how to allow native executables in the remote session.  Aleksandar shared some tips and tricks (like how to add the file system provider so that the shell can navigate to the location of the executable).</p>
<p>I was up next, and talked about PowerShell Workflows.  PowerShell Workflows are a very important new feature, but there are a number of tricky points.  One key thing to remember from PowerShell Workflows is, while they look like PowerShell, they are not only PowerShell, but also Windows Workflow Foundation workflows.  This means that scoping and variable access have some differences from a PowerShell script or module.</p>
<p><a href="http://jdhitsolutions.com/blog/">Jeff Hicks</a> continued with some great tips for Office automation with PowerShell.  He showed us how to use the macro recorder to get an idea of the commands necessary when working with the Office COM objects and gave us a great tip on storing the values of some standard named constants used by Office in a custom object or hashtable for easy retrieval.</p>
<p>The last session of the day was Bruce Payette, the lead language designer.  Bruce talked in further depth about PowerShell Workflows and the underlying architecture for them.  He stressed that PowerShell Workflows be used for an appropriate purpose, like deployment and configuration, and not for things like data aggregation.</p>
<p>The PowerShell Deep Dive was a great event full of excellent content.  If you have not been to the Deep Dive before, you might not realize that the sessions are just the start of the learning here.  The conference attendees are all passionate about building solutions and finding better ways to make themselves more efficient.  The conversations before and after the regular day&#8217;s activities and between sessions is often as informative as the sessions themselves.  In large part, this is due to the great spirit of community around PowerShell that drives its members to share what they&#8217;ve learned.  If you have the opportunity to get to this event or one like it, it is well worth the investment of  your time and effort to be a part of the conversation.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.powershellmagazine.com/2012/05/05/day-3-from-the-powershell-deep-dive-at-tec-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

