<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">

<channel>
	<title>Lead, Follow, or Move » PowerShell</title>
	
	<link>http://www.leadfollowmove.com</link>
	<description>Adam Bell on Deployment, Automation, PowerShell et al</description>
	<lastBuildDate>Fri, 17 Jul 2009 09:26:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/lfm-powershell" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>First look at MDT 2010 Beta 2</title>
		<link>http://www.leadfollowmove.com/archives/powershell/first-look-at-mdt-2010-beta-2</link>
		<comments>http://www.leadfollowmove.com/archives/powershell/first-look-at-mdt-2010-beta-2#comments</comments>
		<pubDate>Wed, 01 Jul 2009 14:56:15 +0000</pubDate>
		<dc:creator>Adam Bell</dc:creator>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[MDT 2010]]></category>

		<guid isPermaLink="false">http://www.leadfollowmove.com/?p=268</guid>
		<description><![CDATA[Michael has been firing out a lot posts about the new features of MDT 2010 recently, and as this is a tool I do quite a lot with I figured it was time to start playing :)
I have a test server with the Beta 1 MDT 2010 already installed. I wanted to see if any [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.technet.com/mniehaus/">Michael</a> has been firing out a lot posts about the new features of MDT 2010 recently, and as this is a tool I do quite a lot with I figured it was time to start playing :)</p>
<p>I have a test server with the Beta 1 MDT 2010 already installed. I wanted to see if any issues are encountered if I just installed over the top. </p>
<p>The installation process didn&#8217;t notify me of any previous version, but it selected the installation directory of the existing MDT. I let it install to the same location, and it completed without any errors.</p>
<div id="attachment_269" class="wp-caption alignleft" style="width: 310px"><a href="http://www.leadfollowmove.com/wp-content/uploads/mdt2010-workbench.png"><img src="http://www.leadfollowmove.com/wp-content/uploads/mdt2010-workbench-300x219.png" alt="The new and improved workbench." title="MDT 2010 - Workbench" width="300" height="219" class="size-medium wp-image-269" /></a><p class="wp-caption-text">The new and improved workbench.</p></div><br />
I like the new shiny icons, but more importantly I like how I can organise things in folders :) </p>
<p>My existing MDT items were all still available, with the exception of the deployment share. Selecting to open an existing share and selecting the upgrade check box appears to have brought everything up to date.<br />
<div id="attachment_271" class="wp-caption alignleft" style="width: 310px"><a href="http://www.leadfollowmove.com/wp-content/uploads/mdt2010-property.png"><img src="http://www.leadfollowmove.com/wp-content/uploads/mdt2010-property-300x245.png" alt="Property page has been updated" title="MDT 2010 - Property Page" width="300" height="245" class="size-medium wp-image-271" /></a><p class="wp-caption-text">Property page has been updated</p></div>
<p>One of my minor annoyances for a long time has been resolved. You can now tab through the fields, though you have to tab through both sides *grrr*.</p>
<p>From a PowerShell perspective a quick look reveals that we have one snapin to play with: <strong>microsoft.bdd.PSsnapin</strong>.<br />
<div id="attachment_272" class="wp-caption alignleft" style="width: 310px"><a href="http://www.leadfollowmove.com/wp-content/uploads/mdt2010-pssnapin1.png"><img src="http://www.leadfollowmove.com/wp-content/uploads/mdt2010-pssnapin1-300x89.png" alt="The PowerShell Snapin for MDT 2010" title="MDT 2010 - PSSnapin" width="300" height="89" class="size-medium wp-image-272" /></a><p class="wp-caption-text">The PowerShell Snapin for MDT 2010</p></div></p>
<div id="attachment_273" class="wp-caption alignleft" style="width: 310px"><a href="http://www.leadfollowmove.com/wp-content/uploads/mdt2010-getcmd.png"><img src="http://www.leadfollowmove.com/wp-content/uploads/mdt2010-getcmd-300x100.png" alt="16 cmdlets are provided by the MDT snapin" title="MDT 2010 - get-command" width="300" height="100" class="size-medium wp-image-273" /></a><p class="wp-caption-text">16 cmdlets are provided by the MDT snapin</p></div>
<p>I haven&#8217;t played with these yet, but they look to be promising.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leadfollowmove.com/archives/powershell/first-look-at-mdt-2010-beta-2/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>News and Events</title>
		<link>http://www.leadfollowmove.com/archives/powershell/news-and-events</link>
		<comments>http://www.leadfollowmove.com/archives/powershell/news-and-events#comments</comments>
		<pubDate>Mon, 29 Jun 2009 15:22:24 +0000</pubDate>
		<dc:creator>Adam Bell</dc:creator>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[MDT 2010]]></category>

		<guid isPermaLink="false">http://www.leadfollowmove.com/?p=265</guid>
		<description><![CDATA[The Summer Scripting Games finished last Friday. There&#8217;s always lots of PowerShell goodness to get you thinking! Richard has been detailing his solutions, and the complete list is available on the Scripting Guy blog.
Microsoft also held a Virtual Conference last week and the video&#8217;s are available here.
MDT 2010 Beta 2 has just been released and [...]]]></description>
			<content:encoded><![CDATA[<p>The Summer Scripting Games finished last Friday. There&#8217;s always lots of PowerShell goodness to get you thinking! <a href="http://richardsiddaway.spaces.live.com">Richard</a> has been detailing his solutions, and the complete list is available on the <a href="http://blogs.technet.com/heyscriptingguy/archive/2009/06/14/everything-scripting-games-come-here-if-you-are-lost.aspx">Scripting Guy blog</a>.</p>
<p>Microsoft also held a Virtual Conference last week and the video&#8217;s are available <a href="http://technet.microsoft.com/en-gb/dd819085.aspx">here</a>.</p>
<p>MDT 2010 Beta 2 has just been released and promises to hold a lot of great improvements. Michael, has shot out a whole bunch of posts in short time detailing some of the new features <a href="http://blogs.technet.com/mniehaus/">here</a>.</p>
<p>Lots of great stuff to watch and play with! :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leadfollowmove.com/archives/powershell/news-and-events/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly Poll #5</title>
		<link>http://www.leadfollowmove.com/archives/powershell/weekly-poll-5</link>
		<comments>http://www.leadfollowmove.com/archives/powershell/weekly-poll-5#comments</comments>
		<pubDate>Mon, 26 May 2008 10:12:37 +0000</pubDate>
		<dc:creator>Adam Bell</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerShell Tools]]></category>
		<category><![CDATA[Weekly Poll]]></category>

		<guid isPermaLink="false">http://www.leadfollowmove.com/?p=244</guid>
		<description><![CDATA[This weeks poll is about 3rd party applications for PowerShell.
If you feel I&#8217;ve omitted someone please drop me a comment. For details check the PowerShell Toolbox
]]></description>
			<content:encoded><![CDATA[<p>This weeks poll is about 3rd party applications for PowerShell.</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
<p>If you feel I&#8217;ve omitted someone please drop me a comment. For details check the <a title="LFM, PowerShell Toolbox" href="http://www.leadfollowmove.com/powershell-toolbox">PowerShell Toolbox</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.leadfollowmove.com/archives/powershell/weekly-poll-5/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Weekly Poll #4</title>
		<link>http://www.leadfollowmove.com/archives/powershell/weekly-poll-4</link>
		<comments>http://www.leadfollowmove.com/archives/powershell/weekly-poll-4#comments</comments>
		<pubDate>Tue, 20 May 2008 09:45:43 +0000</pubDate>
		<dc:creator>Adam Bell</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Weekly Poll]]></category>

		<guid isPermaLink="false">http://www.leadfollowmove.com/?p=243</guid>
		<description><![CDATA[So due to an unfortunate hardware situation we missed last weeks Poll, but It&#8217;s been resolved now, and so here&#8217;s Poll #4:
Here&#8217;s the detailed breakdown of the features in the 2.0 CTP
]]></description>
			<content:encoded><![CDATA[<p>So due to an unfortunate hardware situation we missed last weeks Poll, but It&#8217;s been resolved now, and so here&#8217;s Poll #4:</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
<p><a title="PowerShell Blog: PowerShell 2.0 Features" href="http://blogs.msdn.com/powershell/archive/2007/11/06/what-s-new-in-ctp-of-powershell-2-0.aspx">Here&#8217;s</a> the detailed breakdown of the features in the 2.0 CTP</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leadfollowmove.com/archives/powershell/weekly-poll-4/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Weekly Poll #3</title>
		<link>http://www.leadfollowmove.com/archives/powershell/weekly-poll-3</link>
		<comments>http://www.leadfollowmove.com/archives/powershell/weekly-poll-3#comments</comments>
		<pubDate>Tue, 06 May 2008 12:43:19 +0000</pubDate>
		<dc:creator>Adam Bell</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Weekly Poll]]></category>

		<guid isPermaLink="false">http://www.leadfollowmove.com/?p=241</guid>
		<description><![CDATA[A little late this week, but here it is.
If you feel I&#8217;ve missed any significant options please leave a comment. There&#8217;s becoming quite a tower of power, but I tried to keep the list reasonably short.
]]></description>
			<content:encoded><![CDATA[<p>A little late this week, but here it is.<br />
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.</p>
<p>If you feel I&#8217;ve missed any significant options please leave a comment. There&#8217;s becoming quite a <a title="PowerShell Team Blog:Tower of Power"  href="http://blogs.msdn.com/powershell/archive/2008/03/27/tower-of-power-part-2.aspx">tower of power</a>, but I tried to keep the list reasonably short.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leadfollowmove.com/archives/powershell/weekly-poll-3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerGUI PowerPack Tutorial</title>
		<link>http://www.leadfollowmove.com/archives/powershell/powergui-powerpack-tutorial</link>
		<comments>http://www.leadfollowmove.com/archives/powershell/powergui-powerpack-tutorial#comments</comments>
		<pubDate>Wed, 30 Apr 2008 04:07:49 +0000</pubDate>
		<dc:creator>Adam Bell</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerGui]]></category>
		<category><![CDATA[PowerShell Tools]]></category>

		<guid isPermaLink="false">http://www.leadfollowmove.com/?p=240</guid>
		<description><![CDATA[I have just finished watching a really good tutorial on how to create PowerPacks in PowerGUI.
This gives you a great insight into what can be done with PowerGUI and has given me a few ideas of my own ;)
Well done Kirk, and thanks to Dmitry for pointing it out!
]]></description>
			<content:encoded><![CDATA[<p>I have just finished watching a really good <a title="PowerGUI PowerPack Tutorial" href="http://powergui.org/shares/powergui/sbin/docs/How_to_create_a_PowerPack/How_to_create_a_PowerPack.html">tutorial</a> on how to create PowerPacks in <a title="PowerGui Home Page" href="http://www.powergui.org">PowerGUI</a>.</p>
<p>This gives you a great insight into what can be done with PowerGUI and has given me a few ideas of my own ;)</p>
<p>Well done <a title="Poshoholic Blog" href="http://www.poshoholic.com/">Kirk</a>, and thanks to <a title="Dmitry's Blog: Creating a PowePack" href="http://dmitrysotnikov.wordpress.com/2008/04/29/how-to-create-a-powerpack/">Dmitry</a> for pointing it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leadfollowmove.com/archives/powershell/powergui-powerpack-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly Poll #2</title>
		<link>http://www.leadfollowmove.com/archives/powershell/weekly-poll-2</link>
		<comments>http://www.leadfollowmove.com/archives/powershell/weekly-poll-2#comments</comments>
		<pubDate>Mon, 28 Apr 2008 13:32:46 +0000</pubDate>
		<dc:creator>Adam Bell</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Weekly Poll]]></category>

		<guid isPermaLink="false">http://www.leadfollowmove.com/?p=239</guid>
		<description><![CDATA[This weeks Weekly Poll is now up.
If you&#8217;d like to suggest a poll please email me with Weekly Poll in the subject line.
]]></description>
			<content:encoded><![CDATA[<p>This weeks <a title="Weekly Poll Page" href="http://www.leadfollowmove.com/polls">Weekly Poll</a> is now up.</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
<p>If you&#8217;d like to suggest a poll please email me with <em>Weekly Poll</em> in the subject line.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leadfollowmove.com/archives/powershell/weekly-poll-2/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VMware Infrastructure Toolkit (for Windows) 1.0 Beta</title>
		<link>http://www.leadfollowmove.com/archives/powershell/vmware-infrastructure-toolkit-for-windows-10-beta</link>
		<comments>http://www.leadfollowmove.com/archives/powershell/vmware-infrastructure-toolkit-for-windows-10-beta#comments</comments>
		<pubDate>Fri, 28 Mar 2008 01:37:46 +0000</pubDate>
		<dc:creator>Adam Bell</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Virtualisation]]></category>
		<category><![CDATA[VMware Infrastructure Toolkit]]></category>

		<guid isPermaLink="false">http://www.leadfollowmove.com/archives/powershell/vmware-infrastructure-toolkit-for-windows-10-beta</guid>
		<description><![CDATA[I&#8217;m still in the process of getting sorted now that I&#8217;m back home in Western Australia, so you have probably seen this one already.
Just in case though ;)
VMware have their VI toolkit in beta, and I&#8217;ve been lead to believe that it has lots of PowerShell goodness. There are apparently 102 cmdlets included so a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m still in the process of getting sorted now that I&#8217;m back home in Western Australia, so you have probably seen this one already.</p>
<p>Just in case though ;)</p>
<p>VMware have their VI toolkit in beta, and I&#8217;ve been lead to believe that it has lots of PowerShell goodness. There are apparently 102 cmdlets included so a lot to take a look at and play with. </p>
<p>I&#8217;ve just found out that my main machine is due to arrive on Sunday, so as I am currently a man of leisure, I should have some &#8220;play&#8221; time available over the next week or two :)</p>
<p>The toolkit beta is available <a title="VMware VI toolkit beta" href="http://www.vmware.com/beta/vitk_win/index.html">here</a> and there&#8217;s also a <a title="VMware powershell blog" href="http://blogs.vmware.com/vipowershell">blog</a> available.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leadfollowmove.com/archives/powershell/vmware-infrastructure-toolkit-for-windows-10-beta/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving and Renaming objects in Active Directory</title>
		<link>http://www.leadfollowmove.com/archives/powershell/moving-and-renaming-objects-in-active-directory</link>
		<comments>http://www.leadfollowmove.com/archives/powershell/moving-and-renaming-objects-in-active-directory#comments</comments>
		<pubDate>Tue, 04 Mar 2008 16:07:46 +0000</pubDate>
		<dc:creator>Adam Bell</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Active Directory]]></category>

		<guid isPermaLink="false">http://www.leadfollowmove.com/archives/powershell/moving-and-renaming-objects-in-active-directory</guid>
		<description><![CDATA[I went to move some AD objects with PowerShell recently, and realised that I didn&#8217;t have any examples to hand. Despite covering AD permission delegation and GPO operations, I&#8217;d somehow missed the fairly obvious task of moving and renaming objects! 
So this seemed like a good time fix that &#8230;
We need to bind to some [...]]]></description>
			<content:encoded><![CDATA[<p>I went to move some AD objects with PowerShell recently, and realised that I didn&#8217;t have any examples to hand. Despite covering AD permission delegation and GPO operations, I&#8217;d somehow missed the fairly obvious task of <strong>moving</strong> and <strong>renaming</strong> objects! </p>
<p>So this seemed like a good time fix that &#8230;</p>
<p>We need to bind to some objects in AD, starting with the <em>Users OU</em>, and a fictional OU for our example, <em>Service Accounts</em> where we will move our objects to.</p>
<div class="quickcodenoclick"><code><br />
$root = [adsi]&quot;&quot;<br />
$users = [adsi](&quot;LDAP://cn=users,&quot;+$root.distinguishedName)<br />
$sa = [adsi](&quot;LDAP://ou=Service Accounts,&quot;+$root.distinguishedName)<br />
</code></div>
<p>Now that we have bindings to the directory locations, we need to bind to an account we&#8217;d like to move.</p>
<div class="quickcodenoclick"><code><br />
$admin = [adsi](&quot;LDAP://cn=Administrator,&quot;+$users.distinguishedName)<br />
</code></div>
<p>The actually moving of an object isn&#8217;t made available through the PowerShell wrapper from what I could see. So to achieve this we need to expose the raw .Net methods using <strong>psbase</strong>.</p>
<div class="quickcodenoclick"><code><br />
$admin.psbase | get-member | where-object {$_.Name -eq &quot;MoveTo&quot;}<br />
System.Void MoveTo(DirectoryEntry newParent), System.Void MoveTo(DirectoryEntry newParent, String newName)<br />
</code></div>
<p>I already knew the name of the method we&#8217;d need to use <em>MoveTo()</em>, so we used a <em>where-object</em> cmdlet to reduce our output to just what we needed. Looking at the above method, we can see that we can also rename the object by passing a second set of parameters.</p>
<p>Having bound to the <em>Service Accounts</em> OU, and the <em>Administrator</em> account, the only thing left to do is the actual move:</p>
<div class="quickcodenoclick"><code><br />
$admin.PSBase.MoveTo($sa)<br />
</code></div>
<p>Something to bear in mind if we want to rename an object, is that we could pass the same DirectoryEntry location as the object current exists in, or a new location. This method won&#8217;t update the <strong>sAMAccountName</strong> attribute.</p>
<p>If you want to change attributes on an object, it&#8217;s worth doing this <strong>before</strong> the move, and the binding becomes invalid. In our example of renaming the account, there&#8217;s a couple of attributes worth changing:</p>
<div class="quickcodenoclick"><code><br />
$admin.put(&quot;sAMAccountName&quot;, &quot;zNobodyHere&quot;)<br />
$admin.put(&quot;Description&quot;, &quot;Nobody Service Account&quot;)<br />
$admin.put(&quot;userPrincipalName&quot;, &quot;zNobodyHere@leadfollowmove.com&quot;)<br />
$admin.Setinfo()<br />
</code></div>
<p>Renaming, the Administrator account, and keeping it in the Users container:</p>
<div class="quickcodenoclick"><code><br />
$admin.PSBase.MoveTo($users, &quot;cn=zNobodyHere&quot;)<br />
</code></div>
<p>Renaming the Administrator account, and moving it to our <em>Service Accounts</em> OU:</p>
<div class="quickcodenoclick"><code><br />
$admin.PSBase.MoveTo($sa, &quot;cn=zNobodyHere&quot;)<br />
</code></div>
<p>Alternatively, you could use the <a href="http://www.quest.com/powershell/">Quest AD cmdlets</a> to move or rename. Sometimes, however you don&#8217;t always have the tools available that you might like!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leadfollowmove.com/archives/powershell/moving-and-renaming-objects-in-active-directory/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 2003 DNS Server rights issue</title>
		<link>http://www.leadfollowmove.com/archives/powershell/windows-2003-dns-server-rights-issue</link>
		<comments>http://www.leadfollowmove.com/archives/powershell/windows-2003-dns-server-rights-issue#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:45:11 +0000</pubDate>
		<dc:creator>Adam Bell</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows Server 2003]]></category>
		<category><![CDATA[Active Directory]]></category>

		<guid isPermaLink="false">http://www.leadfollowmove.com/archives/powershell/windows-2003-dns-server-rights-issue</guid>
		<description><![CDATA[Apparently there is a permissions issue regarding hosting DNS zones in the ForestDNSZones, or DomainDNSZones partitions in Server 2003. I haven&#8217;t looked to see if this has been resolved in 2008. The issue and solution is detailed in Microsoft KB939090.

This issue occurs because of the permissions that are set in the Active Directory directory service&#8230;.
The [...]]]></description>
			<content:encoded><![CDATA[<p>Apparently there is a permissions issue regarding hosting DNS zones in the <strong>ForestDNSZones</strong>, or <strong>DomainDNSZones</strong> partitions in Server 2003. I haven&#8217;t looked to see if this has been resolved in 2008. The issue and solution is detailed in <a title="Microsoft Support: KB article 939090" href="http://support.microsoft.com/kb/939090">Microsoft KB939090</a>.</p>
<blockquote><p>
This issue occurs because of the permissions that are set in the Active Directory directory service&#8230;.<br />
The members of the DnsAdmins group do not have permissions on the following application partitions:<br />
CN=MicrosoftDNS,DC=ForestDNSZones,DC=Domain&#8230;<br />
CN=MicrosoftDNS,DC=DomainDNSZones,DC=Domain&#8230;
</p></blockquote>
<p>The documented solution is to edit your Active Directory with ADSIEdit and go in to fix the problem:</p>
<blockquote><p>
To resolve this issue, set permissions for the DnsAdmins group on the DomainDNSZones application partition and on the ForestDNSZones application partition.
</p></blockquote>
<p>We have taken a pretty close look at manipulating permissions in AD with PowerShell before, covering:<br />
<a title="Lead, Follow, or Move: Active Directory Standard Rights" href="http://www.leadfollowmove.com/archives/powershell/active-directory-permissions-standard-rights">Standard Rights</a><br />
<a title="Lead, Follow, or Move: Removing ACE's from Active Directory" href="http://www.leadfollowmove.com/archives/powershell/removing-aces-from-active-directory-with-powershell">Removing Rights in AD</a><br />
<a title="Lead, Follow, or Move: Inheritance and Propagation in Active Directory" href="http://www.leadfollowmove.com/archives/powershell/inheritance-and-propagation-in-active-directory-permissions">Inheritance and Propagation</a><br />
<a title="Lead, Follow, or Move:Extended Rights in Active Directory" href="http://www.leadfollowmove.com/archives/powershell/extended-rights-in-active-directory">Extended Rights</a><br />
and <a title="Lead, Follow, or Move: Control Access Rights in Active Directory" href="http://www.leadfollowmove.com/archives/powershell/control-access-rights-in-active-directory">Controlling Access Rights in AD</a></p>
<p>We&#8217;re going to build a function similar to Add-DsAce.ps1 we used in the Standard Rights post, but this time we&#8217;re going to use a slightly different constructor, so that we can apply the correct inheritance. We want this to affect &#8220;This object and all Child Objects&#8221;, which means we need to use:</p>
<div class="quickcodenoclick"><code><br />
[System.DirectoryServices.ActiveDirectorySecurityInheritance]&quot;SelfAndChildren&quot;<br />
</code></div>
<p>So, our modified function looks like this:<br />
<a class="quickcode" title="Code" href="javascript:toggleLayer('quickcode2292');">Add-DsAce2.ps1</a></p>
<div id="quickcode2292" class="quickcode"><code><br />
#&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;-<br />
function Add-DsAce<br />
#&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;-<br />
{<br />
Param (<br />
&nbsp;&nbsp;$DSobject,<br />
&nbsp;&nbsp;$Identifier,<br />
&nbsp;&nbsp;$DSrights,<br />
&nbsp;&nbsp;$AccessType = &quot;Allow&quot;,<br />
&nbsp;&nbsp;$Inheritance<br />
&nbsp;&nbsp;)<br />
&nbsp;&nbsp;# GetAccessRules: Explicit ACE&#039;s, Inherited ACE&#039;s, TargetType<br />
&nbsp;&nbsp;$account = New-Object system.security.principal.ntaccount($Identifier)<br />
&nbsp;<br />
&nbsp;&nbsp;# Retrieve the SID - as a manual step you can check it&#039;s not empty :)<br />
&nbsp;&nbsp;$sid = $account.translate([system.security.principal.securityidentifier])<br />
&nbsp;<br />
&nbsp;&nbsp;$Inheritance = [System.DirectoryServices.ActiveDirectorySecurityInheritance]&quot;SelfAndChildren&quot;<br />
&nbsp;&nbsp;$ace = New-Object System.DirectoryServices.ActiveDirectoryAccessRule($account, $DSrights, $AccessType, $Inheritance)<br />
&nbsp;&nbsp;$DSobject.psbase.get_objectsecurity().AddAccessRule($ace)<br />
&nbsp;&nbsp;$DSobject.psbase.CommitChanges()<br />
}<br />
#&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;-<br />
</code></div>
<p>Now that we have the ability to modify the AD, and presuming we dot source the newly created function we could do the following:</p>
<div class="quickcodenoclick"><code><br />
$root = [adsi]&quot;&quot;<br />
$ForestDNSZones = [adsi](&quot;LDAP://DC=ForestDNSZones,&quot;+$root.distinguishedName)<br />
$DomainDNSZones = [adsi](&quot;LDAP://CN=MicrosoftDNS, DC=DomainDNSZones,&quot;+$root.distinguishedName)<br />
&nbsp;<br />
Add-DSace $ForestDNSZones &quot;DNSAdmins&quot; &quot;GenericAll&quot;<br />
Add-DSAce $DomainDNSZones &quot;DNSAdmins&quot; &quot;GenericAll&quot;<br />
</code></div>
<p>Basically, we&#8217;ve bound to AD via ADSI so that we can dynamically provide the domain DN, and the two locations in AD we want to apply the ACE to. Then it&#8217;s just a matter of passing the created function the parameters needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leadfollowmove.com/archives/powershell/windows-2003-dns-server-rights-issue/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
