<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>jfrmilner&#039;s Tech Blog</title>
	<atom:link href="http://jfrmilner.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jfrmilner.wordpress.com</link>
	<description>The online scrapbook of another IT Professional..</description>
	<lastBuildDate>Sun, 01 Jan 2012 11:43:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jfrmilner.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/781da1f250d86ef571a971feaf7cd2a3?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>jfrmilner&#039;s Tech Blog</title>
		<link>http://jfrmilner.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jfrmilner.wordpress.com/osd.xml" title="jfrmilner&#039;s Tech Blog" />
	<atom:link rel='hub' href='http://jfrmilner.wordpress.com/?pushpress=hub'/>
		<item>
		<title>jfrmilner Blog statistics for 2011</title>
		<link>http://jfrmilner.wordpress.com/2012/01/01/jfrmilner-blog-statistics-for-2011/</link>
		<comments>http://jfrmilner.wordpress.com/2012/01/01/jfrmilner-blog-statistics-for-2011/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 11:43:04 +0000</pubDate>
		<dc:creator>jfrmilner</dc:creator>
				<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://jfrmilner.wordpress.com/?p=234</guid>
		<description><![CDATA[The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog. Here&#8217;s an excerpt: A New York City subway train holds 1,200 people. This blog was viewed about 5,800 times in 2011. If it were a NYC subway train, it would take about 5 trips to carry that many people. Click here to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=234&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.</p>
<p><a href="/2011/annual-report/"><img src="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" alt="" width="100%" /></a></p>
<p>Here&#8217;s an excerpt:</p>
<blockquote><p>A New York City subway train holds 1,200 people. This blog was viewed about <strong>5,800</strong> times in 2011. If it were a NYC subway train, it would take about 5 trips to carry that many people.</p></blockquote>
<p><a href="/2011/annual-report/">Click here to see the complete report.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jfrmilner.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jfrmilner.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jfrmilner.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jfrmilner.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jfrmilner.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jfrmilner.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jfrmilner.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jfrmilner.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jfrmilner.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jfrmilner.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jfrmilner.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jfrmilner.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jfrmilner.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jfrmilner.wordpress.com/234/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=234&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jfrmilner.wordpress.com/2012/01/01/jfrmilner-blog-statistics-for-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4993cc66e993089a79c293cc48d0d242?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jfrmilner</media:title>
		</media:content>

		<media:content url="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" medium="image" />
	</item>
		<item>
		<title>Reformatting Telephone numbers to the E.164 format with PowerShell</title>
		<link>http://jfrmilner.wordpress.com/2011/09/28/reformatting-telephone-numbers-to-the-e-164-format-with-powershell/</link>
		<comments>http://jfrmilner.wordpress.com/2011/09/28/reformatting-telephone-numbers-to-the-e-164-format-with-powershell/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 17:28:38 +0000</pubDate>
		<dc:creator>jfrmilner</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://jfrmilner.wordpress.com/?p=219</guid>
		<description><![CDATA[This month we have a new Avaya phone system being implemented for one of my customers and one of the prerequisites to get full functionality is to have all telephone numbers in the popular E.164 format. This would be a pretty simple task if the data was in a consistent format but unfortunately this was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=219&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This month we have a new <a href="http://www.avaya.com/uk/">Avaya</a> phone system being implemented for one of my customers and one of the prerequisites to get full functionality is to have all telephone numbers in the popular <a href="http://en.wikipedia.org/wiki/E.164">E.164</a> format. This would be a pretty simple task if the data was in a consistent format but unfortunately this was not the case, let’s take a look at the state of the data*:</p>
<p>*For security reasons I have recreated the data in my test lab with random names, area codes and telephone numbers etc.</p>
<p>First I will store a collection of Users in a variable named $users, throughout this post I will use the <a href="http://www.quest.com/powershell/activeroles-server.aspx">Quest AD cmdlets</a>. This is mainly because they are backwards compatible with 2003 based domains but if you are lucky enough to be 2008 you should be able to convert the commands to <a href="http://technet.microsoft.com/en-us/library/dd378937(WS.10).aspx">Microsoft’s AD Module</a> with little effort.</p>
<p><pre class="brush: powershell; light: true; wrap-lines: true;">
$users = Get-QADUser -Description &quot;E164 Sample Accounts&quot;
</pre></p>
<p>And now display just the name and telephoneNumber properties:</p>
<p><pre class="brush: powershell; light: true; wrap-lines: true;">
$users | Select-Object Name, telephoneNumber | Format-Table -AutoSize
</pre><br />
<pre class="brush: powershell; light: true; wrap-lines: true;">
Name              telephoneNumber
----              ---------------
Georgina.Stewart  554861
Georgina.Stewart1 01234 12 34 56 (only call on Tues)
Eden.Morris       01234-55(4487)
Sarah.Patel       559642
Marley.Adams      550998
Mya.Lewis         (01234) 127075
Sophia.Baker      (55)2912
Filip.Rogers      (55)8996
Noah.Mason        (Part Time)-(01234) 897740
Isabel.Webb       (01234) 036428
Steven.Matthews   (01234) 957823
Courtney.Walker   (01234) 679860
Rayyan.Mitchell   07123 530656
Mary.Graham       07123  822057
Maisy.Barnes      07123 364461
Arabella.Thompson +441234844048
Macy.Adams
Grace.Robinson    (01234) 538794
Summer.Stevens    Call me before 11AM 550997
Frederick.Taylor  01234588239
</pre></p>
<p>As you can see we have quite a mix bag here. One of the first things to notice is that the telephoneNumber property has not been strictly used for just numbers and as such it is difficult to see any format patterns, let’s strip all non-digit characters away and take another look:</p>
<p><pre class="brush: powershell; light: true; wrap-lines: true;">
$users | Select-Object Name, @{name=&quot;telephoneNumberDigitsOnly&quot;;expression={$_.telephoneNumber -replace &quot;\D&quot;}} | Format-Table –AutoSize
</pre></p>
<p>The above line uses a replace with a single argument so this is effectively a remove. The replace uses a regular expression of Non-Digit contained within a <a href="http://technet.microsoft.com/en-us/library/ff730948.aspx">calculated property</a>.</p>
<p><pre class="brush: powershell; light: true; wrap-lines: true;">
Name              telephoneNumberDigitsOnly
----              -------------------------
Georgina.Stewart  554861
Georgina.Stewart1 01234123456
Eden.Morris       01234554487
Sarah.Patel       559642
Marley.Adams      550998
Mya.Lewis         01234127075
Sophia.Baker      552912
Filip.Rogers      558996
Noah.Mason        01234897740
Isabel.Webb       01234036428
Steven.Matthews   01234957823
Courtney.Walker   01234679860
Rayyan.Mitchell   07123530656
Mary.Graham       07123822057
Maisy.Barnes      07123364461
Arabella.Thompson 441234844048
Macy.Adams
Grace.Robinson    01234538794
Summer.Stevens    11550997
Frederick.Taylor  01234588239
</pre></p>
<p>Now that looks better with the exception of Summer.Stevens, it’s expected that some accounts will need manual effort so I will need to filter for those as well. We can see from the above table that there are two common number formats (1,2), blanks (3), numbers already in <a href="http://en.wikipedia.org/wiki/E.164">E.164</a> format and finally we’ll need a catch all(5) for everything else:</p>
<ol>
<li>Starting with “55” followed by four numbers</li>
<li>Starting with “01 or 07” followed by nine numbers</li>
<li>Blank/Null values</li>
<li>E.164 formatted numbers (No change required)</li>
<li>Neither of the above formats, for example Summer.Stevens</li>
</ol>
<div>
<p>The next step is to create regular expressions to match these four values as the fifth will be a catch for non-matched values, like so:</p>
</div>
<ol>
<li>&#8220;^(01|07)\d{9}&#8221;</li>
<li>&#8220;^55\d{4}&#8221;</li>
<li>&#8220;^$&#8221;</li>
<li>&#8220;^44\d{10}&#8221;</li>
</ol>
<p>Now let’s put all of this together and get a feel for how things will look:</p>
<p><pre class="brush: powershell; wrap-lines: false;">
foreach ($user in $users) {
	switch -regex ($user | % { $user.telephoneNumber -replace &quot;\D&quot; } ) {
	&quot;^(01|07)\d{9}&quot;		{ Add-Member -InputObject $user -Name &quot;E164Number&quot; -MemberType NoteProperty -Value ([regex]::matches(($user.telephoneNumber -replace &quot;\D&quot;),&quot;^(01|07)\d{9}&quot;)[0].Value -replace '^0','+44') ; continue }
	&quot;^55\d{4}&quot;			{ Add-Member -InputObject $user -Name &quot;E164Number&quot; -MemberType NoteProperty -Value ([regex]::matches(($user.telephoneNumber -replace &quot;\D&quot;),&quot;^55\d{4}&quot;)[0].Value -replace '^55','+44123455') ; continue }
	&quot;^$&quot;				{ Write-Warning &quot;Blank&quot; ; continue } #Empty
	&quot;^44\d{10}&quot;			{ if ($user.telephoneNumber -match &quot;^\+\d{12}&quot;) { Write-Warning &quot;E.164: $($user.sAMAccountName), $($user.telephoneNumber)&quot; } else { Write-Warning &quot;No Match: $($user.sAMAccountName), `&quot;$($user.telephoneNumber)`&quot;&quot;} ; continue}
	default 			{ Write-Warning &quot;No Match: $($user.sAMAccountName), `&quot;$($user.telephoneNumber)`&quot;&quot; }
	}
}</pre></p>
<p>As you can see from the above script block I have used a foreach loop that then uses a switch statement. The switch then checks to see if it can match one of the regular expressions patterns from the previous step and if successful adds a new note property named “E164Number” else it will display a warning. Let’s give it a try:</p>
<p><pre class="brush: powershell; light: true; wrap-lines: true;">
WARNING: E.164: Arabella.Thompson, +441234844048
WARNING: Blank
WARNING: No Match: Summer.Stevens, &quot;Call me before 11AM 550997&quot;
</pre></p>
<p>As predicted we have a few warnings, now let’s have a look at the projected telephone numbers:</p>
<p><pre class="brush: powershell; light: true; wrap-lines: true;">
$users | Select-Object Name, telephoneNumber, E164Number | Format-Table -AutoSize
</pre><br />
<pre class="brush: powershell; light: true; wrap-lines: true;">
Name              telephoneNumber                     E164Number
----              ---------------                     ----------
Georgina.Stewart  554861                              +441234554861
Georgina.Stewart1 01234 12 34 56 (only call on Tues)  +441234123456
Eden.Morris       01234-55(4487)                      +441234554487
Sarah.Patel       559642                              +441234559642
Marley.Adams      550998                              +441234550998
Mya.Lewis         (01234) 127075                      +441234127075
Sophia.Baker      (55)2912                            +441234552912
Filip.Rogers      (55)8996                            +441234558996
Noah.Mason        (Part Time)-(01234) 897740          +441234897740
Isabel.Webb       (01234) 036428                      +441234036428
Steven.Matthews   (01234) 957823                      +441234957823
Courtney.Walker   (01234) 679860                      +441234679860
Rayyan.Mitchell   07123 530656                        +447123530656
Mary.Graham       07123  822057                       +447123822057
Maisy.Barnes      07123 364461                        +447123364461
Arabella.Thompson +441234844048
Macy.Adams
Grace.Robinson    (01234) 538794                      +441234538794
Summer.Stevens    Call me before 11AM 550997
Frederick.Taylor  01234588239                         +441234588239
</pre></p>
<p>Very nice. Now to make this permanent we need to push the <a href="http://en.wikipedia.org/wiki/E.164">E164</a>Number property into the telephoneNumber property on each of these users:</p>
<p>Backup first:</p>
<p><pre class="brush: powershell; light: true; wrap-lines: true;">
$users | Export-Csv C:\Support\MyBackup.csv -NoTypeInformation
</pre></p>
<p>Once the blackup task has been completed we can now go ahead and apply the new number. Notice that I used an if statement to check that there actually is a value in the E164Number property first and if there isn’t then it will skip that user.</p>
<p><pre class="brush: powershell; light: true; wrap-lines: true;"> $users | ForEach-Object { if ($_.E164Number) {Set-QADUser -Identity $_ -PhoneNumber $_.E164Number}} </pre></p>
<p>Now to confirm the results:</p>
<p><pre class="brush: powershell; light: true; wrap-lines: true;">
$users | Get-QADuser | Select-Object Name, telephoneNumber | Format-Table -AutoSize
</pre><br />
<pre class="brush: powershell; light: true; wrap-lines: true;">
Name              telephoneNumber
----              ---------------
Georgina.Stewart  +441234554861
Georgina.Stewart1 +441234123456
Eden.Morris       +441234554487
Sarah.Patel       +441234559642
Marley.Adams      +441234550998
Mya.Lewis         +441234127075
Sophia.Baker      +441234552912
Filip.Rogers      +441234558996
Noah.Mason        +441234897740
Isabel.Webb       +441234036428
Steven.Matthews   +441234957823
Courtney.Walker   +441234679860
Rayyan.Mitchell   +447123530656
Mary.Graham       +447123822057
Maisy.Barnes      +447123364461
Arabella.Thompson +441234844048
Macy.Adams
Grace.Robinson    +441234538794
Summer.Stevens    Call me before 11AM 550997
Frederick.Taylor  +441234588239
</pre></p>
<p>Excellent, the majority of users now have an <a href="http://en.wikipedia.org/wiki/E.164">E164</a> formatted phone number.</p>
<p>All that’s left now is to identify users that still do not conform to this format so that they can be contacted, this can be achieved by using a Where-Object with another regular expression like so:</p>
<p><pre class="brush: powershell; light: true; wrap-lines: true;">
$users | Get-QADUser | Where-Object { $_.telephoneNumber -notmatch &quot;^\+\d{12}&quot; } | Select-Object name, email
</pre><br />
<pre class="brush: powershell; light: true; wrap-lines: true;">
Name           Email
----           -----
Macy.Adams     Macy.Adams@jfrmilner.lab
Summer.Stevens Summer.Stevens@jfrmilner.lab
</pre></p>
<p>Well that wraps up this post; I think you’ll agree it’s a nice real world example of using PowerShell with regular expressions to solve formatting issues.</p>
<p>Thanks for reading and until next time.</p>
<p>Regards,</p>
<p>jfrmilner</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jfrmilner.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jfrmilner.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jfrmilner.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jfrmilner.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jfrmilner.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jfrmilner.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jfrmilner.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jfrmilner.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jfrmilner.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jfrmilner.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jfrmilner.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jfrmilner.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jfrmilner.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jfrmilner.wordpress.com/219/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=219&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jfrmilner.wordpress.com/2011/09/28/reformatting-telephone-numbers-to-the-e-164-format-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4993cc66e993089a79c293cc48d0d242?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jfrmilner</media:title>
		</media:content>
	</item>
		<item>
		<title>Checking for &#8220;Dead&#8221; paths on HBAs with PowerCLI</title>
		<link>http://jfrmilner.wordpress.com/2011/08/27/checking-for-dead-paths-on-hbas-with-powercli/</link>
		<comments>http://jfrmilner.wordpress.com/2011/08/27/checking-for-dead-paths-on-hbas-with-powercli/#comments</comments>
		<pubDate>Sat, 27 Aug 2011 15:28:52 +0000</pubDate>
		<dc:creator>jfrmilner</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Virtualisation]]></category>

		<guid isPermaLink="false">http://jfrmilner.wordpress.com/?p=204</guid>
		<description><![CDATA[This week I have been tasked with assisting a storage engineer while he replaces a couple of Fibre Channel switches. My task was simple, check the HBAs for any “Dead” paths (See below screen shot for an example) across all the ESX hosts every hour for a weekend. We have a fair few VMHosts so [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=204&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This week I have been tasked with assisting a storage engineer while he replaces a couple of Fibre Channel switches. My task was simple, check the HBAs for any “Dead” paths (See below screen shot for an example) across all the ESX hosts every hour for a weekend. We have a fair few VMHosts so this gave me the opportunity to use <a href="http://www.vmware.com/support/developer/PowerCLI/PowerCLI41U1/html/index.html">PowerCLI </a>(Think PowerShell with a VMware snapin).</p>
<p><a href="http://jfrmilner.files.wordpress.com/2011/08/image001.gif"><img class="alignnone size-full wp-image-205" title="DeadHBAPaths" src="http://jfrmilner.files.wordpress.com/2011/08/image001.gif?w=614" alt=""   /></a></p>
<p>It didn’t take long at all to knock up a little script that can report on path states, this is what I came up with:</p>
<p><pre class="brush: powershell; wrap-lines: false;">
$VMHosts = Get-VMHost  | ? { $_.ConnectionState -eq &quot;Connected&quot; } | Sort-Object -Property Name
$results= @()

foreach ($VMHost in $VMHosts) {
Get-VMHostStorage -RescanAllHba -VMHost $VMHost | Out-Null
[ARRAY]$HBAs = $VMHost | Get-VMHostHba -Type &quot;FibreChannel&quot;

	foreach ($HBA in $HBAs) {
    $pathState = $HBA | Get-ScsiLun | Get-ScsiLunPath | Group-Object -Property state
    $pathStateActive = $pathState | ? { $_.Name -eq &quot;Active&quot;}
    $pathStateDead = $pathState | ? { $_.Name -eq &quot;Dead&quot;}
    $pathStateStandby = $pathState | ? { $_.Name -eq &quot;Standby&quot;}
    $results += &quot;{0},{1},{2},{3},{4},{5}&quot; -f $VMHost.Name, $HBA.Device, $VMHost.Parent, [INT]$pathStateActive.Count, [INT]$pathStateDead.Count, [INT]$pathStateStandby.Count
    }

}
ConvertFrom-Csv -Header &quot;VMHost&quot;,&quot;HBA&quot;,&quot;Cluster&quot;,&quot;Active&quot;,&quot;Dead&quot;,&quot;Standby&quot; -InputObject $results | Ft -AutoSize
</pre></p>
<p>The output is pretty simple but does the job:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">
VMHost                            HBA    Cluster        Active Dead Standby
------                            ---    -------        ------ ---- -------
d1-vmesx-001.*************.uk    vmhba2 Cluster05      40     0    24
d1-vmesx-001.*************.uk    vmhba3 Cluster05      40     0    24
d2-vmesx-001.****************.uk vmhba2 Cluster02      98     0    80
d2-vmesx-001.****************.uk vmhba3 Cluster02      96     0    80
d2-vmesx-011.****************.uk vmhba2 Cluster03      76     0    88
d2-vmesx-011.****************.uk vmhba3 Cluster03      75     0    85
d2-vmesx-012.****************.uk vmhba2 Cluster03      76     0    88
d2-vmesx-012.****************.uk vmhba3 Cluster03      75     0    85
d2-vmesx-013.****************.uk vmhba1 Cluster03      83     0    85
d2-vmesx-013.****************.uk vmhba2 Cluster03      83     0    85
d2-vmesx-014.****************.uk vmhba1 Cluster03      83     0    85
d2-vmesx-014.****************.uk vmhba2 Cluster03      83     0    85
d2-vmesx-015.****************.uk vmhba1 Cluster03      83     0    85
d2-vmesx-015.****************.uk vmhba2 Cluster03      83     0    85
d2-vmesx-016.****************.uk vmhba1 Cluster03      83     0    85
d2-vmesx-016.****************.uk vmhba2 Cluster03      83     0    85
d2-vmesx-017.****************.uk vmhba1 MSCS Cluster01 44     0    308
d2-vmesx-017.****************.uk vmhba2 MSCS Cluster01 44     0    308
d2-vmesx-018.****************.uk vmhba1 MSCS Cluster01 44     0    308
d2-vmesx-018.****************.uk vmhba2 MSCS Cluster01 44     0    308
d2-vmesx-019.****************.uk vmhba1 Cluster04      68     0    52
d2-vmesx-019.****************.uk vmhba2 Cluster04      68     0    52
d2-vmesx-021.****************.uk vmhba1 Cluster04      68     0    52
d2-vmesx-021.****************.uk vmhba2 Cluster04      68     0    52
</pre></p>
<p>If you wanted to work with this information further then I would suggest creating a custom object and populating the properties with <a href="http://technet.microsoft.com/en-us/library/dd347695.aspx">Add-Member</a> instead of doing the format string method above, I just did that as it’s quick. Well this is my first PowerCLI script, I hope to share some more.</p>
<p>Bye for now.</p>
<p>jfrmilner</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jfrmilner.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jfrmilner.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jfrmilner.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jfrmilner.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jfrmilner.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jfrmilner.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jfrmilner.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jfrmilner.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jfrmilner.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jfrmilner.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jfrmilner.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jfrmilner.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jfrmilner.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jfrmilner.wordpress.com/204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=204&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jfrmilner.wordpress.com/2011/08/27/checking-for-dead-paths-on-hbas-with-powercli/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4993cc66e993089a79c293cc48d0d242?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jfrmilner</media:title>
		</media:content>

		<media:content url="http://jfrmilner.files.wordpress.com/2011/08/image001.gif" medium="image">
			<media:title type="html">DeadHBAPaths</media:title>
		</media:content>
	</item>
		<item>
		<title>Enable VT and install the Hyper-V Role with PowerShell Remoting</title>
		<link>http://jfrmilner.wordpress.com/2011/08/07/enable-vt-and-install-the-hyper-v-role-with-powershell-remoting/</link>
		<comments>http://jfrmilner.wordpress.com/2011/08/07/enable-vt-and-install-the-hyper-v-role-with-powershell-remoting/#comments</comments>
		<pubDate>Sun, 07 Aug 2011 14:53:55 +0000</pubDate>
		<dc:creator>jfrmilner</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Virtualisation]]></category>

		<guid isPermaLink="false">http://jfrmilner.wordpress.com/?p=196</guid>
		<description><![CDATA[I had a situation where I needed to enable the Virtualisation Technology (VT) across a bunch of Dell servers and then install the Hyper-V role. It turned out to be much simpler than I originally thought thanks in part to PowerShell remoting and Dells omconfig. Dell give you the option to change BIOS configuration from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=196&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had a situation where I needed to enable the Virtualisation Technology (VT) across a bunch of Dell servers and then install the Hyper-V role. It turned out to be much simpler than I originally thought thanks in part to PowerShell remoting and Dells <a href="http://support.dell.com/support/edocs/software/svradmin/1.9/en/cli/cli_cc7c.htm">omconfig</a>.</p>
<p>Dell give you the option to change BIOS configuration from the command line, for example to enable the CPU VT:</p>
<p><pre class="brush: powershell; wrap-lines: true;">

omconfig chassis biossetup attribute=cpuvt setting=enabled

</pre></p>
<p>In addition to the above I would also need to install the Hyper-V role:</p>
<p><pre class="brush: powershell; wrap-lines: true;">
Import-Module ServerManager ; Add-WindowsFeature Hyper-V
</pre></p>
<p>This can be combined into a PowerShell remote command like so ($allServers is an array of all the server host names I want to execute the command against):</p>
<p><pre class="brush: powershell; wrap-lines: true;">
icm -ComputerName $allServers -ScriptBlock { omconfig chassis biossetup attribute=cpuvt setting=enabled ; Import-Module ServerManager ; Add-WindowsFeature Hyper-V }
</pre></p>
<p>Next I needed to create a software virtual switch, for this I used a script from</p>
<p><a href="http://blogs.technet.com/b/virtualization/archive/2008/05/26/hyper-v-wmi-using-powershell-scripts-part-5.aspx">http://blogs.technet.com/b/virtualization/archive/2008/05/26/hyper-v-wmi-using-powershell-scripts-part-5.aspx</a> :</p>
<p><pre class="brush: powershell; wrap-lines: true;">
$VirtualSwitchService = get-wmiobject -class &quot;Msvm_VirtualSwitchManagementService&quot; -namespace &quot;root\virtualization&quot;
$ReturnObject = $VirtualSwitchService.CreateSwitch([guid]::NewGuid().ToString(), &quot;DELL NETWORK TEAM - Virtual Network&quot;, &quot;1024&quot;,&quot;&quot;)

#Create New Virtual Switch
$CreatedSwitch = [WMI]$ReturnObject.CreatedVirtualSwitch

#Create Internal Switch Port
$ReturnObject = $VirtualSwitchService.CreateSwitchPort($CreatedSwitch, [guid]::NewGuid().ToString(), &quot;InternalSwitchPort&quot;, &quot;&quot;)
$InternalSwitchPort = [WMI]$ReturnObject.CreatedSwitchPort

#Create External Switch Port
$ReturnObject = $VirtualSwitchService.CreateSwitchPort($CreatedSwitch, [guid]::NewGuid().ToString(), &quot;ExternalSwitchPort&quot;, &quot;&quot;)
$ExternalSwitchPort = [WMI]$ReturnObject.CreatedSwitchPort

$ExternalNic = get-wmiobject -namespace &quot;root\virtualization&quot; -Query &quot;Select * From Msvm_ExternalEthernetPort WHERE IsBound=False&quot; | ? { $_.Name -eq 'BASP Virtual Adapter'}

#Call SetupSwitch
$Job = $VirtualSwitchService.SetupSwitch($ExternalSwitchPort, $InternalSwitchPort, $ExternalNic, [guid]::NewGuid().ToString(), &quot;InternalEthernetPort&quot;)
while (([WMI]$Job.Job.JobState -eq 2) -or ([WMI]$Job.Job.JobState -eq 3) -or ([WMI]$Job.Job.JobState -eq 4)) {Start-Sleep -m 100}
[WMI]$Job.Job
</pre></p>
<p>And finally reboot them all (they actually reboot twice as part of the Hypervisor installtion):</p>
<p><pre class="brush: powershell; wrap-lines: true;">
icm -ComputerName $allServers -ScriptBlock { Restart-Computer -Force }
</pre></p>
<p>With the above I managed to enable and install Hyper-V across 70 severs simultaneously with less than a couple of hours of effort, nice!</p>
<p>Kind Regards,</p>
<p>jfrmilner</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jfrmilner.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jfrmilner.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jfrmilner.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jfrmilner.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jfrmilner.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jfrmilner.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jfrmilner.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jfrmilner.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jfrmilner.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jfrmilner.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jfrmilner.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jfrmilner.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jfrmilner.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jfrmilner.wordpress.com/196/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=196&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jfrmilner.wordpress.com/2011/08/07/enable-vt-and-install-the-hyper-v-role-with-powershell-remoting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4993cc66e993089a79c293cc48d0d242?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jfrmilner</media:title>
		</media:content>
	</item>
		<item>
		<title>Audit Share Permissions PowerShell Script</title>
		<link>http://jfrmilner.wordpress.com/2011/05/02/audit-share-permissions-powershell-script/</link>
		<comments>http://jfrmilner.wordpress.com/2011/05/02/audit-share-permissions-powershell-script/#comments</comments>
		<pubDate>Mon, 02 May 2011 13:09:00 +0000</pubDate>
		<dc:creator>jfrmilner</dc:creator>
				<category><![CDATA[File Server Administration]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://jfrmilner.wordpress.com/?p=185</guid>
		<description><![CDATA[This month I find myself in the need for a quick way to do a simple audit on share permissions on a bunch of files servers. As always I wanted to use PowerShell Remoting (with the code executing on the local server) to accomplish this as enumerating shares is a slow process at the best [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=185&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This month I find myself in the need for a quick way to do a simple audit on share permissions on a bunch of files servers. As always I wanted to use PowerShell Remoting (with the code executing on the local server) to accomplish this as enumerating shares is a slow process at the best of times and over the wire this would have been painfully slow.</p>
<p>Before writing a script I always see if anyone has done this already and in this case yes, I stumbled upon <a href="http://www.peetersonline.nl/index.php/powershell/listing-share-permissions-for-remote-shares">http://www.peetersonline.nl/index.php/powershell/listing-share-permissions-for-remote-shares</a></p>
<p>The only thing missing for my requirements was the need to have both the share name and server name adding to the object, this obviously is very minor and only required a couple of alterations, for example:</p>
<p><pre class="brush: powershell; wrap-lines: true;">
function Get-SharePermissions
{
	param([string]$computername,[string]$sharename)
	$ShareSec = Get-WmiObject -Class Win32_LogicalShareSecuritySetting -ComputerName $computername
	ForEach ($ShareS in ($ShareSec | Where {$_.Name -eq $sharename}))
	{
		$SecurityDescriptor = $ShareS.GetSecurityDescriptor()
		$Global:myCol = @()
		ForEach ($DACL in $SecurityDescriptor.Descriptor.DACL)
		{
			$myObj = &quot;&quot; | Select ID, AccessMask, AceType
			$myObj.ID = $DACL.Trustee.Name
			$myObj | Add-Member -MemberType NoteProperty -Name Server -Value $computername
			$myObj | Add-Member -MemberType NoteProperty -Name Share -Value $sharename
			Switch ($DACL.AccessMask)
			{
				2032127 {$AccessMask = &quot;FullControl&quot;}
				1179785 {$AccessMask = &quot;Read&quot;}
				1180063 {$AccessMask = &quot;Read, Write&quot;}
				1179817 {$AccessMask = &quot;ReadAndExecute&quot;}
				-1610612736 {$AccessMask = &quot;ReadAndExecuteExtended&quot;}
				1245631 {$AccessMask = &quot;ReadAndExecute, Modify, Write&quot;}
				1180095 {$AccessMask = &quot;ReadAndExecute, Write&quot;}
				268435456 {$AccessMask = &quot;FullControl (Sub Only)&quot;}
				default {$AccessMask = $DACL.AccessMask}
			}
			$myObj.AccessMask = $AccessMask
			Switch ($DACL.AceType)
			{
				0 {$AceType = &quot;Allow&quot;}
				1 {$AceType = &quot;Deny&quot;}
				2 {$AceType = &quot;Audit&quot;}
			}
			$myObj.AceType = $AceType
			Clear-Variable AccessMask -ErrorAction SilentlyContinue
			Clear-Variable AceType -ErrorAction SilentlyContinue
			$myCol += $myObj
		}
	}
	Return $myCol
}

Get-SharePermissions -computername $ENV:COMPUTERNAME -sharename $args[0]
</pre></p>
<p>Like previous post on my blog I will use PowerShell remoting with a variable for the Servers ($allServers) and having saved the above code (C:\Scripts\Get-SharePermissions.ps1):</p>
<p><pre class="brush: powershell; wrap-lines: true;">

icm $allServers -FilePath C:\Scripts\Get-SharePermissions.ps1 -ArgumentList Wallpaper$

</pre></p>
<p>And the results:</p>
<p><a href="http://jfrmilner.files.wordpress.com/2011/05/get-sharepermissions.jpg"><img class="alignnone size-medium wp-image-186" title="Get-SharePermissions" src="http://jfrmilner.files.wordpress.com/2011/05/get-sharepermissions.jpg?w=141&#038;h=300" alt="" width="141" height="300" /></a></p>
<p>Thanks for reading and I hope you find this useful. Also special thanks to the orginal author of this excellent script Hugo Peeters @ <a href="http://www.peetersonline.nl/">http://www.peetersonline.nl/</a></p>
<p>Regards,</p>
<p>jfrmilner</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jfrmilner.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jfrmilner.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jfrmilner.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jfrmilner.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jfrmilner.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jfrmilner.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jfrmilner.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jfrmilner.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jfrmilner.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jfrmilner.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jfrmilner.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jfrmilner.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jfrmilner.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jfrmilner.wordpress.com/185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=185&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jfrmilner.wordpress.com/2011/05/02/audit-share-permissions-powershell-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4993cc66e993089a79c293cc48d0d242?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jfrmilner</media:title>
		</media:content>

		<media:content url="http://jfrmilner.files.wordpress.com/2011/05/get-sharepermissions.jpg?w=141" medium="image">
			<media:title type="html">Get-SharePermissions</media:title>
		</media:content>
	</item>
		<item>
		<title>Get Folder Size PowerShell Script</title>
		<link>http://jfrmilner.wordpress.com/2011/05/02/get-folder-size-powershell-script/</link>
		<comments>http://jfrmilner.wordpress.com/2011/05/02/get-folder-size-powershell-script/#comments</comments>
		<pubDate>Mon, 02 May 2011 12:17:59 +0000</pubDate>
		<dc:creator>jfrmilner</dc:creator>
				<category><![CDATA[File Server Administration]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://jfrmilner.wordpress.com/?p=176</guid>
		<description><![CDATA[One of my clients was experiencing slow logon times after enabling roaming profiles and this was tracked down to large profiles. I needed to write a quick script that would tell me the folder size across a bunch of file servers. I decided to create a function for this task named Get-FolderSize and this is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=176&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of my clients was experiencing slow logon times after enabling roaming profiles and this was tracked down to large profiles. I needed to write a quick script that would tell me the folder size across a bunch of file servers.</p>
<p>I decided to create a function for this task named Get-FolderSize and this is the code:</p>
<p><pre class="brush: powershell; wrap-lines: true;">
function Get-FolderSize {
param ( [Parameter(Mandatory=$true)] [System.String]${Path}	)

$objFSO = New-Object -com  Scripting.FileSystemObject
$folders = (dir $path | ? {$_.PSIsContainer -eq $True})
foreach ($folder in $folders)
    {
    $folder | Add-Member -MemberType NoteProperty -Name &quot;SizeMB&quot; -Value (($objFSO.GetFolder($folder.FullName).Size) / 1MB) -PassThru
    }

}
Get-FolderSize $args[0]
</pre></p>
<p>To use this code on a local machine simply execute the above function and call it, for example Get-FolderSize D:\FileData. Now as previously mentioned I wanted to be able to check a large bunch of File Servers and to do that I would first need to create a variable to hold my servers, for example $allServers, then save the above code to the executing server for example C:\Scripts\Get-FolderSize.ps1. This finally allowed me to run the following command:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: true;">
$folders = icm $allServers -FilePath C:\Scripts\Get-FolderSize.ps1 -ArgumentList &quot;E:\Profiles&quot;
 </pre></p>
<p>Now to see the top 10 worst offenders with a filter to show only two decimal places:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: true;">
 $folders | sort -Property SizeMB -Descending | select fullname,@{n='SizeMBN2';e={&quot;{0:N2}&quot; -f $_.SizeMB}} | select -First 10
 </pre></p>
<p>Well as you can see from the below screen my client has some profiles to clean up but at least now they know which ones.</p>
<p><a href="http://jfrmilner.files.wordpress.com/2011/05/get-foldersize.jpg"><img class="alignnone size-full wp-image-177" title="Get-FolderSize" src="http://jfrmilner.files.wordpress.com/2011/05/get-foldersize.jpg?w=614" alt=""   /></a></p>
<p>Thanks for reading and I hope you find this useful.</p>
<p>Regards,</p>
<p>jfrmilner</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jfrmilner.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jfrmilner.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jfrmilner.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jfrmilner.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jfrmilner.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jfrmilner.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jfrmilner.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jfrmilner.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jfrmilner.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jfrmilner.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jfrmilner.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jfrmilner.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jfrmilner.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jfrmilner.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=176&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jfrmilner.wordpress.com/2011/05/02/get-folder-size-powershell-script/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4993cc66e993089a79c293cc48d0d242?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jfrmilner</media:title>
		</media:content>

		<media:content url="http://jfrmilner.files.wordpress.com/2011/05/get-foldersize.jpg" medium="image">
			<media:title type="html">Get-FolderSize</media:title>
		</media:content>
	</item>
		<item>
		<title>Audit NTFS Permissions PowerShell Script</title>
		<link>http://jfrmilner.wordpress.com/2011/05/01/audit-ntfs-permissions-powershell-script/</link>
		<comments>http://jfrmilner.wordpress.com/2011/05/01/audit-ntfs-permissions-powershell-script/#comments</comments>
		<pubDate>Sun, 01 May 2011 19:23:57 +0000</pubDate>
		<dc:creator>jfrmilner</dc:creator>
				<category><![CDATA[NTFS]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://jfrmilner.wordpress.com/?p=164</guid>
		<description><![CDATA[This month I find myself in the need for a quick way to do a simple audit of NTFS permissions on a bunch of files servers. As always I wanted to use PowerShell Remoting (with the code executing on the local server) to accomplish this as enumerating permissions is a slow process at the best [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=164&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This month I find myself in the need for a quick way to do a simple audit of NTFS permissions on a bunch of files servers. As always I wanted to use PowerShell Remoting (with the code executing on the local server) to accomplish this as enumerating permissions is a slow process at the best of times and over the wire this would have been painfully slow.</p>
<p>Now I know that you can use some of the *CACLS executables to do this but if you’ve ever used these tools you will know they seem to default to information overload. All I wanted to do is get the permissions of a path and then check for any inheritance breaks on all its child folders, and be able to export to CSV.</p>
<p>This is the code that I came up with:</p>
<p><pre class="brush: powershell; wrap-lines: true;">
function Get-PathPermissions {

param ( [Parameter(Mandatory=$true)] [System.String]${Path}	)

	begin {
	$root = Get-Item $Path
	($root | get-acl).Access | Add-Member -MemberType NoteProperty -Name &quot;Path&quot; -Value $($root.fullname).ToString() -PassThru
	}
	process {
	$containers = Get-ChildItem -path $Path -recurse | ? {$_.psIscontainer -eq $true}
	if ($containers -eq $null) {break}
		foreach ($container in $containers)
		{
		(Get-ACL $container.fullname).Access | ? { $_.IsInherited -eq $false } | Add-Member -MemberType NoteProperty -Name &quot;Path&quot; -Value $($container.fullname).ToString() -PassThru
		}
	}
}
Get-PathPermissions $args[0]
</pre></p>
<p>To use this code on a local machine simply execute the above function and call it, for example Get-PathPermissions D:\FileData. Now as previously mentioned I wanted to be able to audit a large bunch of File Servers and to do that I would first need to create a variable to hold my servers, for example $allServers, then save the above code to the executing server for example C:\Scripts\Get-PathPermissions.ps1. This finally allowed me to run the following command:</p>
<p><pre class="brush: powershell; wrap-lines: true;">

icm $allServers -FilePath C:\Scripts\Get-PathPermissions.ps1 -ArgumentList &quot;E:\WallPaper&quot; | Export-Csv C:\PermissionsAudit.csv –NoTypeInformation

</pre></p>
<p>The output (C:\PermissionsAudit.csv) can now be manipulated in Excel, for example:</p>
<p><a href="http://jfrmilner.files.wordpress.com/2011/05/audit-ntfs-permissions-powershell-script-excelexample.jpg"><img class="alignnone size-full wp-image-167" title="audit-ntfs-permissions-powershell-script-ExcelExample" src="http://jfrmilner.files.wordpress.com/2011/05/audit-ntfs-permissions-powershell-script-excelexample.jpg?w=614&#038;h=441" alt="" width="614" height="441" /></a></p>
<p>As you can see this provides very simple and easy to read output that can ease auditing NTFS permissions in bulk.</p>
<p>Thanks for reading and I hope you find this useful.</p>
<p>Regards,</p>
<p>jfrmilner</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jfrmilner.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jfrmilner.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jfrmilner.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jfrmilner.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jfrmilner.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jfrmilner.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jfrmilner.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jfrmilner.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jfrmilner.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jfrmilner.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jfrmilner.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jfrmilner.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jfrmilner.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jfrmilner.wordpress.com/164/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=164&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jfrmilner.wordpress.com/2011/05/01/audit-ntfs-permissions-powershell-script/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4993cc66e993089a79c293cc48d0d242?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jfrmilner</media:title>
		</media:content>

		<media:content url="http://jfrmilner.files.wordpress.com/2011/05/audit-ntfs-permissions-powershell-script-excelexample.jpg" medium="image">
			<media:title type="html">audit-ntfs-permissions-powershell-script-ExcelExample</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert DCs to RODCs in bulk using PowerShell (Part 3 of 3)</title>
		<link>http://jfrmilner.wordpress.com/2010/12/06/convert-dcs-to-rodcs-in-bulk-using-powershell-part-3-of-3/</link>
		<comments>http://jfrmilner.wordpress.com/2010/12/06/convert-dcs-to-rodcs-in-bulk-using-powershell-part-3-of-3/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 21:13:41 +0000</pubDate>
		<dc:creator>jfrmilner</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://jfrmilner.wordpress.com/?p=141</guid>
		<description><![CDATA[Part 3 of 3 First Post (Part 1 of 3) Previous Post (Part 2 of 3) Step 7 &#8211; Force a restart of the Servers I now need to be sure that the servers are online. A quick way to test that a bunch of systems are online after a reboot it to use the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=141&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Part 3 of 3</p>
<p><a title="Convert DCs to RODCs in bulk using PowerShell (Part 1 of 3)" href="http://jfrmilner.wordpress.com/2010/11/29/convert-dcs-to-rodcs-in-bulk-using-powershell-part-1-of-3/">First Post (Part 1 of 3)</a></p>
<p><a title="Convert DCs to RODCs in bulk using PowerShell (Part 2 of 3)" href="http://jfrmilner.wordpress.com/2010/11/30/convert-dcs-to-rodcs-in-bulk-using-powershell-part-2-of-3/">Previous Post (Part 2 of 3)</a></p>
<p><strong>Step 7 &#8211; Force a restart of the Servers</strong></p>
<p>I now need to be sure that the servers are online. A quick way to test that a bunch of systems are online after a reboot it to use the Test-Connection cmdlet, for example to single ping the first ten servers that I demoted:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">
Test-Connection $Servers[0..9] -Count 1
</pre></p>
<p>After confirming the servers were back online I restarted them again, this oddly was necessary to freshen up the systems as they seemed a little flaky on the first restart after a demotion. Instead of using the Restart-Computer cmdlet I used the old shutdown.exe command as I found it more reliable dealing with unhappy servers, the command I used was:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">
$Servers[0..9] | % {  shutdown /r /m \\$($_) }
</pre></p>
<p>After the second restart I tested that PowerShell remoting with CredSSP authentication was again working using the same command as before:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">
icm $Servers { $ENV:ComputerName } -Authentication CredSSP -Credential $Cred
</pre></p>
<p><strong>Step 8 &#8211; ReDCPROMO to RODC</strong></p>
<p>Completing all the previous steps I was now ready to promote all the member servers to RODCs.</p>
<p>Much like the command used for step 6 here is the command I used to promote the first 10 servers.</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">
icm $Servers[0..9] { dcpromo.exe /unattend:C:\SUPPORT\DCPROMORODCAnswerFile.txt | Tee-Object -filepath C:\SUPPORT\DCPROMORODCResultFile.txt } -Authentication CredSSP -Credential $Cred
</pre></p>
<p>Again the output for this command is both seen on the console and saved to the file C:\SUPPORT\DCPROMORODCResultFile.txt local to each server. Due to the IFM cache of AD the whole promotion completed very quickly, with some completing in only a few minutes.</p>
<p>You should now find the RODCs returned to the ‘Domain Controllers’ OU but now the DC Type will show Read-only.</p>
<p><strong>Step 9 &#8211; Replicate the Passwords for the User and Computer Objects to the local RODC responsible for authentication</strong></p>
<p>Now that all the DCs had been converted to RODCs I wanted to be sure that I pre-cached all the computer accounts and user account passwords local to that site using the groups created in Step 1. The command line tool RepAdmin can be used for such a task with the /rodcpwdrepl switch, this will first check the computer/user object is allowed to be cached and if confirmed will then add the password hash to the RODCs cache. Interestingly you can only add single user or computer account to the RODC cache using ADUC and not groups or as I needed all accounts contained within an OU.</p>
<p>I achieved this using the help of the Microsoft AD module. As mentioned before the AD Site Name in this company also matches up with the name of the OU holding the objects for that AD Site, so with that in mind I checked what the local site code was and then used that to construct the Distinguished Name of the OU, I then enumerated all users/computers and passed this onto the RepAdmin tool.</p>
<p>Here is the example of populating the RODC cache with User accounts:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">
icm $Servers[0..9] { import-module ActiveDirectory ; $siteCode = [DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().name  ; Get-ADUser -SearchBase &quot;OU=Staff,OU=Users,OU=$($siteCode),OU=Schools,DC=domain1,DC=sch,DC=uk&quot; -filter * | % { Repadmin /rodcpwdrepl D1-$($siteCode)-001 D1-DC-001 $_.DistinguishedName }} -Authentication CredSSP -Credential $Cred
</pre></p>
<p>And finally here is the example of populating the RODC cache with Computer Accounts:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">
icm $Servers[0..9] { import-module ActiveDirectory ; $siteCode = [DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().name  ; Get-ADComputer -SearchBase &quot;OU=$($siteCode),OU=Schools,DC=domain1,DC=sch,DC=uk&quot; -filter * | % { Repadmin /rodcpwdrepl D1-$($siteCode)-001 D1-DC-001 $_.DistinguishedName }} -Authentication CredSSP -Credential $Cred
</pre></p>
<p>You can easily confirm which accounts are cached on your server by selecting the properties on the RODC, selecting the “Password Replication Policy” tab, clicking the Advanced button and confirming that “Accounts Whose Password are stored on this Read-only Domain Controller” is selected from the drop down box.</p>
<p>I used this process to successfully convert over 150 full DCs to RODCs and I found it an excellent example of how PowerShell remoting can save you significant amounts of time and making a repetitive task like this a breeze!</p>
<p><strong>A couple of final thoughts:</strong></p>
<p>1.	Be sure to monitor your replication over the coming days and get familiar with the repadmin command line utility.</p>
<p>2.	It would be wise to remove the IFM caches from your local disks as soon as you are ready and be sure not to use them after the tombstone lifetime.</p>
<p>Thanks for reading.</p>
<p>Regards,</p>
<p>jfrmilner</p>
<p>This post is provided “AS IS” with no warranties or guarantees, and confers no rights.</p>
<div id="_mcePaste" class="mcePaste" style="position:absolute;left:-10000px;top:114px;width:1px;height:1px;overflow:hidden;"></p>
<p>[/sourcecode]&nbsp;</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jfrmilner.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jfrmilner.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jfrmilner.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jfrmilner.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jfrmilner.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jfrmilner.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jfrmilner.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jfrmilner.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jfrmilner.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jfrmilner.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jfrmilner.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jfrmilner.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jfrmilner.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jfrmilner.wordpress.com/141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=141&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jfrmilner.wordpress.com/2010/12/06/convert-dcs-to-rodcs-in-bulk-using-powershell-part-3-of-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4993cc66e993089a79c293cc48d0d242?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jfrmilner</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert DCs to RODCs in bulk using PowerShell (Part 2 of 3)</title>
		<link>http://jfrmilner.wordpress.com/2010/11/30/convert-dcs-to-rodcs-in-bulk-using-powershell-part-2-of-3/</link>
		<comments>http://jfrmilner.wordpress.com/2010/11/30/convert-dcs-to-rodcs-in-bulk-using-powershell-part-2-of-3/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 14:49:27 +0000</pubDate>
		<dc:creator>jfrmilner</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://jfrmilner.wordpress.com/?p=135</guid>
		<description><![CDATA[Part 2 of 3 Previous Post (Part 1 of 3) Final Post (Part 3 of 3) Step 4 &#8211; Enable CredSSP (multihop-authentication) Before I could start using DCPROMO I needed to enable multihop-authentication using CredSSP. Now I will not explain this in detail, instead I would like to refer you to the excellent post by [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=135&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Part 2 of 3</p>
<p><a title="Convert DCs to RODCs in bulk using PowerShell (Part 1 of 3)" href="http://jfrmilner.wordpress.com/2010/11/29/convert-dcs-to-rodcs-in-bulk-using-powershell-part-1-of-3/">Previous Post (Part 1 of 3)</a></p>
<p><a title="Convert DCs to RODCs in bulk using PowerShell (Part 3 of 3)" href="http://jfrmilner.wordpress.com/2010/12/06/convert-dcs-to-rodcs-in-bulk-using-powershell-part-3-of-3/">Final Post (Part 3 of 3)</a></p>
<p><strong>Step 4 &#8211; Enable CredSSP (multihop-authentication)</strong></p>
<p>Before I could start using DCPROMO I needed to enable multihop-authentication using CredSSP. Now I will not explain this in detail, instead I would like to refer you to the excellent post by Ravikanth Chaganti &#8211; <a title="http://www.ravichaganti.com/blog/?p=1230" href="http://www.ravichaganti.com/blog/?p=1230">http://www.ravichaganti.com/blog/?p=1230 </a></p>
<p>As this will need to be allowed in bulk then I suggest you use the GPO :<br />
<em>Computer Configuration/Administrative Templates/Windows Components/Windows Remote Management (WinRM)/WinRM Service/Allow CredSSP authentication</em></p>
<p>This policy setting allows you to manage whether the Windows Remote Management (WinRM) service accepts CredSSP authentication from a remote client. Once enabled this policy sets the WinRM service to accept CredSSP authentication from a remote client.</p>
<p>The management client will also need to be configured to allow credentials to be passed onto remote clients. In my case I only wanted to allow this on my management server so I used this command on that system:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">

Enable-WSManCredSSP -Role Client -DelegateComputer *.domain1.sch.uk

</pre></p>
<p>This command once enabled basically allows me to pass my credentials onto any system in the domain that has the WinRM service configured to accept CredSSP authentication.</p>
<p>I recommend that you give this a test run before moving onto the next step.<br />
Create a variable $Cred and store the account you’re going to be using for the DCPROMO commands, for example:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">

$Cred = Get-Credential DOMAIN1\DomainAdmin

</pre></p>
<p>Then use Invoke-Command to echo back the server name(s) of each remote system:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">
icm $Servers { $ENV:ComputerName } -Authentication CredSSP -Credential $Cred

</pre></p>
<p><strong>Step 5 &#8211; Create DCPROMO demote and RODC promote answer files using a word replace template method</strong></p>
<p>The idea of this is quite simple, first create a DCPROMO demote and a RODC promotion answer files from a test/lab server and use these as templates. The template will be loaded into RAM and if necessary a word replace will be performed creating the unique answer file needed, the file will then be saved onto the target server. This was the code used to create the two answer files:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: true;">

$SiteCodes| % {
$DCPROMODemote = gc 'C:\Scripts\DCPROMODemoteTemplate.txt'
$DCPROMODemote | Out-File &quot;\\D1-$($_)-001\C$\Support\DCPROMODemote.txt&quot; -Encoding ascii
Write-Host &quot;File Saved: \\D1-$($_)-001\C$\Support\DCPROMODemote.txt&quot;
$DCPROMORODCTemplate = gc 'C:\Scripts\DCPROMO-RODC-Template.txt'
$DCPROMORODCAnswerFile = $DCPROMORODCTemplate -replace '',$($_)
$DCPROMORODCAnswerFile | Out-File &quot;\\D1-$($_)-001\C$\Support\DCPROMORODCAnswerFile.txt&quot; -Encoding ascii
Write-Host &quot;File Saved: \\D1-$($_)-001\C$\Support\DCPROMORODCAnswerFile.txt&quot;
}

</pre></p>
<p>Next the answer file used for the DCPROMO demotion, no word replacement was necessary.</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: true;">

; DCPROMO unattend file - Auth jfrmilner
; Usage:
;   dcpromo.exe /unattend:C:\SUPPORT\DCPROMODemote.txt
;
[DCInstall]
; Demotion
RetainDcMetadata=No
IsLastDCInDomain=No
AdministratorPassword=passwordgoeshere
RebootOnCompletion=Yes

</pre></p>
<p>This was the template answer file used for the DCPROMO RODC promotion. All text that matched ‘&lt;SiteCode&gt;’ was replaced with the Site Code passed from the pipeline, for example if the first value in the $SiteCode variable was ‘AFCPS’ then the line ‘PasswordReplicationAllowed=&#8221;DOMAIN1\&lt;SiteCode&gt;-Laptops&#8221;’ would be changed to ‘PasswordReplicationAllowed=&#8221;DOMAIN1\AFCPS-Laptops&#8221;’.</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: true;">

; DCPROMO unattend file - Auth jfrmilner
; Usage:
;   dcpromo.exe /unattend:C:\Support\DCPROMORODCAnswerFile.txt
;
[DCInstall]
; Read-Only Replica DC promotion
ReplicaOrNewDomain=ReadOnlyReplica
ReplicaDomainDNSName=domain1.sch.uk
; RODC Password Replication Policy
PasswordReplicationDenied=&quot;BUILTIN\Administrators&quot;
PasswordReplicationDenied=&quot;BUILTIN\Server Operators&quot;
PasswordReplicationDenied=&quot;BUILTIN\Backup Operators&quot;
PasswordReplicationDenied=&quot;BUILTIN\Account Operators&quot;
PasswordReplicationDenied=&quot;DOMAIN1\Denied RODC Password Replication Group&quot;
PasswordReplicationAllowed=&quot;DOMAIN1\Allowed RODC Password Replication Group&quot;
PasswordReplicationAllowed=&quot;DOMAIN1\&lt;SiteCode&gt;-Laptops&quot;
PasswordReplicationAllowed=&quot;DOMAIN1\&lt;SiteCode&gt;-Pupils&quot;
PasswordReplicationAllowed=&quot;DOMAIN1\&lt;SiteCode&gt;-Staff&quot;
PasswordReplicationAllowed=&quot;DOMAIN1\&lt;SiteCode&gt;-Workstations&quot;
; D1-RODC-Admins will include the Service Desk Global Group
DelegatedAdmin=&quot;DOMAIN1\D1-RODC-Admins&quot;
SiteName=&lt;SiteCode&gt;
InstallDNS=Yes
ConfirmGc=Yes
CreateDNSDelegation=No
UserDomain=domain1.sch.uk
UserName=DOMAIN1\DomainAdmin
Password= passwordgoeshere
ReplicationSourcePath=&quot;C:\Support\IFM_RODC&quot;
ReplicationSourceDC=D1-DC-001.domain1.sch.uk
DatabasePath=&quot;C:\Windows\NTDS&quot;
LogPath=&quot;C:\Windows\NTDS&quot;
SYSVOLPath=&quot;C:\Windows\SYSVOL&quot;
SafeModeAdminPassword= passwordgoeshere
; Run-time flags (optional)
; CriticalReplicationOnly=Yes
RebootOnCompletion=Yes

</pre></p>
<p>I should point out that the passwords in these files are stored in clear text when they are created. The passwords are removed from each file after they have been used as answer files for the DCPROMO tasks, with this in mind you should consider carefully which account you use and not to create these files until you are ready to use them.</p>
<p><strong>Step 6 &#8211; DCPROMO demote the DC to a Member Server </strong></p>
<p>Before I began to demote servers I created a new OU titled ‘DCPROMO Holding’, this OU also had a GPO linked that would enable PowerShell remoting. By default a demoted server would be returned to the Computer OU and because of this would have all GPO’s removed.</p>
<p>With all the prerequisites out of the way I could now start demoting Domain Controllers back to Member Servers.<br />
I did about ten servers at a time and I suggest you do the same. I did this by using the Range operator, for example say $Servers was a 100 item array, writing $Servers[0..9] would select the first 10 and $Servers[10..19] would be the next ten etc..</p>
<p>This is the code I used for the first 10:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">

icm $Servers[0..9] { dcpromo.exe /unattend:C:\SUPPORT\DCPROMODEMOTE.txt | Tee-Object -filepath C:\SUPPORT\DCPROMODEMOTEResultFile.txt } -Authentication CredSSP -Credential $Cred

</pre></p>
<p>Note the Tee-Object cmdlet, this allows the output of the promotion to appear on the console and also a text file. It would not be difficult to parse the text file for detailed information or collect the data and concatenate this information into a single report.</p>
<p>All went to plan, the computer objects for all ten systems were returned to the Computers OU. Checking this OU is actually the quickest way to get an overall feel of the success of the bulk demotion. I then moved the computer objects from the Computers OU to the ‘DCPROMO Holding’ OU.</p>
<p>Thanks for reading. I will post the final part over the course of the week so please check back.</p>
<p>Regards,</p>
<p>jfrmilner</p>
<div id="_mcePaste" class="mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:1332px;width:1px;height:1px;">
<p><!--[if gte mso 9]&gt;    &lt;![endif]--><!--[if gte mso 9]&gt;  Normal 0     false false false  EN-GB X-NONE X-NONE                           &lt;![endif]--><!--[if gte mso 9]&gt;                                                                                                                                            &lt;![endif]--><!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0cm; 	margin-right:0cm; 	margin-bottom:10.0pt; 	margin-left:0cm; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi; 	mso-fareast-language:EN-US;} p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing 	{mso-style-priority:1; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi; 	mso-fareast-language:EN-US;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi; 	mso-fareast-language:EN-US;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page WordSection1 	{size:612.0pt 792.0pt; 	margin:72.0pt 72.0pt 72.0pt 72.0pt; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.WordSection1 	{page:WordSection1;} --><!--[if gte mso 10]&gt; &lt;!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Table Normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin-top:0cm; 	mso-para-margin-right:0cm; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0cm; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:&quot;Times New Roman&quot;; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} --> <!--[endif]--></p>
<p class="MsoNoSpacing">; DCPROMO unattend file &#8211; Auth jfrmilner</p>
<p class="MsoNoSpacing">; Usage:</p>
<p class="MsoNoSpacing">;   dcpromo.exe /unattend:C:\Support\DCPROMORODCAnswerFile.txt</p>
<p class="MsoNoSpacing">;</p>
<p class="MsoNoSpacing">[DCInstall]</p>
<p class="MsoNoSpacing">; Read-Only Replica DC promotion</p>
<p class="MsoNoSpacing">ReplicaOrNewDomain=ReadOnlyReplica</p>
<p class="MsoNoSpacing">ReplicaDomainDNSName=domain1.sch.uk</p>
<p class="MsoNoSpacing">; RODC Password Replication Policy</p>
<p class="MsoNoSpacing">PasswordReplicationDenied=&#8221;BUILTIN\Administrators&#8221;</p>
<p class="MsoNoSpacing">PasswordReplicationDenied=&#8221;BUILTIN\Server Operators&#8221;</p>
<p class="MsoNoSpacing">PasswordReplicationDenied=&#8221;BUILTIN\Backup Operators&#8221;</p>
<p class="MsoNoSpacing">PasswordReplicationDenied=&#8221;BUILTIN\Account Operators&#8221;</p>
<p class="MsoNoSpacing">PasswordReplicationDenied=&#8221;DOMAIN1\Denied RODC Password Replication Group&#8221;</p>
<p class="MsoNoSpacing">PasswordReplicationAllowed=&#8221;DOMAIN1\Allowed RODC Password Replication Group&#8221;</p>
<p class="MsoNoSpacing">PasswordReplicationAllowed=&#8221;DOMAIN1\&lt;SiteCode&gt;-Laptops&#8221;</p>
<p class="MsoNoSpacing">PasswordReplicationAllowed=&#8221;DOMAIN1\&lt;SiteCode&gt;-Pupils&#8221;</p>
<p class="MsoNoSpacing">PasswordReplicationAllowed=&#8221;DOMAIN1\&lt;SiteCode&gt;-Staff&#8221;</p>
<p class="MsoNoSpacing">PasswordReplicationAllowed=&#8221;DOMAIN1\&lt;SiteCode&gt;-Workstations&#8221;</p>
<p class="MsoNoSpacing">; D1-RODC-Admins will include the Service Desk Global Group</p>
<p class="MsoNoSpacing">DelegatedAdmin=&#8221;DOMAIN1\D1-RODC-Admins&#8221;</p>
<p class="MsoNoSpacing">SiteName=&lt;SiteCode&gt;</p>
<p class="MsoNoSpacing">InstallDNS=Yes</p>
<p class="MsoNoSpacing">ConfirmGc=Yes</p>
<p class="MsoNoSpacing">CreateDNSDelegation=No</p>
<p class="MsoNoSpacing">UserDomain=domain1.sch.uk</p>
<p class="MsoNoSpacing">UserName=DOMAIN1\DomainAdmin</p>
<p class="MsoNoSpacing">Password= passwordgoeshere</p>
<p class="MsoNoSpacing">ReplicationSourcePath=&#8221;C:\Support\IFM_RODC&#8221;</p>
<p class="MsoNoSpacing">ReplicationSourceDC=D1-DC-001.domain1.sch.uk</p>
<p class="MsoNoSpacing">DatabasePath=&#8221;C:\Windows\NTDS&#8221;</p>
<p class="MsoNoSpacing">LogPath=&#8221;C:\Windows\NTDS&#8221;</p>
<p class="MsoNoSpacing">SYSVOLPath=&#8221;C:\Windows\SYSVOL&#8221;</p>
<p class="MsoNoSpacing">SafeModeAdminPassword= passwordgoeshere</p>
<p class="MsoNoSpacing">; Run-time flags (optional)</p>
<p class="MsoNoSpacing">; CriticalReplicationOnly=Yes</p>
<p class="MsoNoSpacing">RebootOnCompletion=Yes</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jfrmilner.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jfrmilner.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jfrmilner.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jfrmilner.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jfrmilner.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jfrmilner.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jfrmilner.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jfrmilner.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jfrmilner.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jfrmilner.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jfrmilner.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jfrmilner.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jfrmilner.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jfrmilner.wordpress.com/135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=135&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jfrmilner.wordpress.com/2010/11/30/convert-dcs-to-rodcs-in-bulk-using-powershell-part-2-of-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4993cc66e993089a79c293cc48d0d242?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jfrmilner</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert DCs to RODCs in bulk using PowerShell (Part 1 of 3)</title>
		<link>http://jfrmilner.wordpress.com/2010/11/29/convert-dcs-to-rodcs-in-bulk-using-powershell-part-1-of-3/</link>
		<comments>http://jfrmilner.wordpress.com/2010/11/29/convert-dcs-to-rodcs-in-bulk-using-powershell-part-1-of-3/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 18:31:23 +0000</pubDate>
		<dc:creator>jfrmilner</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://jfrmilner.wordpress.com/?p=122</guid>
		<description><![CDATA[Part 1 of 3 Next Post (Part 2 of 3) Final Post (Part 3 of 3) Scenario: This month presented me with an interesting issue that I would like to share. In effort to provide Role Based Accounts (RBA) to both 1st and 2nd Line Support it became clear that 2nd Line needed to locally [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=122&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Part 1 of 3</p>
<p><a title="Convert DCs to RODCs in bulk using PowerShell (Part 2 of 3)" href="http://jfrmilner.wordpress.com/2010/11/30/convert-dcs-to-rodcs-in-bulk-using-powershell-part-2-of-3/">Next Post (Part 2 of 3)</a></p>
<p><a title="Convert DCs to RODCs in bulk using PowerShell (Part 3 of 3)" href="http://jfrmilner.wordpress.com/2010/12/06/convert-dcs-to-rodcs-in-bulk-using-powershell-part-3-of-3/">Final Post (Part 3 of 3)</a></p>
<p>Scenario: This month presented me with an interesting issue that I would like to share. In effort to provide Role Based Accounts (RBA) to both 1st and 2nd Line Support it became clear that 2nd Line needed to locally administer DCs as they also acted as File Servers at some sites, but being a member of Domain Admins was overkill and as such went against Least Privilege best practices. The solution to this issue was to convert all non-dedicated DCs or FSMO Role holders to Read Only Domain Controllers (RODCs). RODCs run as member servers with a local Security Accounts Manager (SAM) and run AD as an isolated service; this allowed me to configure dedicated local administration. This was achieved by adding the 2nd Line role based account group to the BUILTIN\Administrators group on each local RODC. There are other benefits to RODCs but I’ll not cover those in this post.</p>
<p>Now the issue is that this particular Domain has over 150 DCs that need to be converted to RODCs with the majority being on slow WAN links. I needed to find a way to do this with minimum network traffic, in a consistent manor (to keep the Change Manager happy) and quickly. This was how I did it:</p>
<p><strong>Summary of steps to perform:</strong><br />
1.	Sort all Computer and User Objects into Groups that will be used for Password Replication Policies.<br />
2.	Set the DNS Server options on each DC NIC to point back to the Core DCs in Head Office.<br />
3.	Use the “Install From Media” option of NTDSUTIL to create two local cache copies of the Active Directory. One will be for RODCs and the other will be for Full DCs, the latter could be used for Roll Back scenarios should I wish to restore the DC to its original state.<br />
4.	Enable CredSSP used for multihop authentication.<br />
5.	Create DCPROMO demote and RODC promote answer files using a word replace template method.<br />
6.	DCPROMO demote the DC to a Member Server.<br />
7.	Force a restart of the Servers.<br />
8.	ReDCPROMO to RODC.<br />
9.	Replicate the Passwords for the User and Computer Objects to the local RODC responsible for authentication.</p>
<p><strong>Step 1 &#8211; Sort all Computer and User Objects into Groups that will be used for Password Replication Policies</strong></p>
<p>Luckily this step was particularly straight forward for me due to the fact that we use a five letter code for each customer and this code is used to reference the Site, Parent OU and is also used to prefix the Computer Objects. All I needed to do was create an array of all the Site Codes and store it in a variable called $siteCode, then pass that through to a foreach loop that collected all the Computer Objects for that OU and then added them to a Group following a simple pattern match.</p>
<p>This is the code that I used for the first batch of ten (Please note that I used the free Quest AD cmdlets for this and some of the other steps and as such they will need to be installed for this to work):</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">

$siteCodes[0..9] | % {
$siteCode = $($_)
#Sort Computer Membership
$Comps = Get-QADComputer -OU domain1.sch.uk/Schools/$siteCode | ? { $_.memberof.count -ne 1 }
$Comps | ? { $_.Name -match &quot;$($siteCode)W&quot; } | % { Add-QADGroupMember -Identity &quot;$($siteCode)-Workstations&quot; -Member $_.DN }
$Comps | ? { $_.Name -match &quot;$($siteCode)L&quot; } | % { Add-QADGroupMember -Identity &quot;$($siteCode)-Laptops&quot; -Member $_.DN }
}
</pre></p>
<p>I also used the below code to list any Computer Objects that were not a member of a single Group, which for me mainly highlighted incorrectly named systems.</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">

$siteCodes[0..9] | % {
$siteCode = $($_)
#Check for Problem Systems
Get-QADComputer -OU domain1.sch.uk/Schools/$siteCode | select name,@{name='MemberShipCount';expression={$_.memberof.count}} | ? { $_.Membershipcount -ne 1 }
}

</pre></p>
<p><strong>Step 2 &#8211; Set the DNS Server options on each DC NIC to point back to the Full DCs in Head Office.</strong></p>
<p>If you’re going to DCPROMO demote a Server from a DC to a Member Server you will need to be sure that the Server does not reference itself as a DNS Server. I needed to find the teamed NIC that is configured with the DNS registered IP Address of that Server and reconfigure the DNS Search Order. I did this by using PowerShell Remoting to first collect the IP Address from DNS that references the Servers host name and then that information to find the NIC with that configured, and then use a WMI method to set this NICs DNS Search Order to an Array using a couple of DNS Server from Head Office.</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">

#Set DNS
icm $Servers -ScriptBlock {  $DNSArray = '10.10.10.10','10.10.10.11' ; (Get-WmiObject -class win32_networkadapterconfiguration | ? { $_.IPAddress -eq ( ([System.Net.Dns]::GetHostEntry($ENV:ComputerName).AddressList | ? { $_.AddressFamily -eq 'InterNetwork' }).IPAddressToString ) } ).SetDNSServerSearchOrder($DNSArray) }

</pre></p>
<p>To Check my configuration Changes:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">

#Audit DNS
icm $Servers -ScriptBlock { Get-WmiObject -class win32_networkadapterconfiguration | ? { $_.IPAddress -eq ( ([System.Net.Dns]::GetHostEntry($ENV:ComputerName).AddressList | ? { $_.AddressFamily -eq 'InterNetwork' }).IPAddressToString )} } | select __SERVER,IPAddress,DNSServerSearchOrder

</pre></p>
<p><strong>Step 3 &#8211; Use the “Install From Media” (IFM) option of NTDSUTIL to create two local cache copies of the Active Directory. </strong><br />
One will be for RODCs and the other will be for Full DCs, the latter could be used for Roll Back scenarios should I wish to restore the DC to its original state.</p>
<p>To begin with I needed to increase the amount of memory that a PowerShell remoting session can use from the default 150MB to 1GB due to the memory hungry IFM process. This setting can be restored as soon as you have finished creating your IFM snapshots. Using the Group Policy Management Console (GPMC) I edited the policy that manages Remoting and edited the setting Computer Configuration/Administrative Templates/Windows Components/Windows Remote Shell/ Specify maximum amount of memory in MB per Shell, this option should look like Figure1.</p>
<div id="attachment_126" class="wp-caption alignnone" style="width: 412px"><a href="http://jfrmilner.files.wordpress.com/2010/11/rodc-gpomaxmempershellmb.jpg"><img class="size-full wp-image-126" title="RODC-GPOMaxMemPerShellMB" src="http://jfrmilner.files.wordpress.com/2010/11/rodc-gpomaxmempershellmb.jpg?w=614" alt="RODC-GPOMaxMemPerShellMB"   /></a><p class="wp-caption-text">RODC-GPOMaxMemPerShellMB</p></div>
<p>The next step is to create the actual IFM snapshots using NTDSUTIL. This again was achieved using PowerShell Remoting; here is the code I used:</p>
<p><pre class="brush: powershell; gutter: false; wrap-lines: false;">

icm $Servers -ScriptBlock { ntdsutil &quot;Activate Instance NTDS&quot; ifm &quot;Create SYSVOL Full C:\Support\IFM_Full&quot; q q &gt;&gt; C:\Support\IFM_Full.log }
icm $Servers -ScriptBlock { ntdsutil &quot;Activate Instance NTDS&quot; ifm &quot;Create SYSVOL RODC C:\Support\IFM_RODC&quot; q q &gt;&gt; C:\Support\IFM_RODC.log }

</pre></p>
<p>Thanks for reading. I will post the remaining two parts over the course of the week so please check back.</p>
<p>Regards,</p>
<p>jfrmilner</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jfrmilner.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jfrmilner.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jfrmilner.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jfrmilner.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jfrmilner.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jfrmilner.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jfrmilner.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jfrmilner.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jfrmilner.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jfrmilner.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jfrmilner.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jfrmilner.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jfrmilner.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jfrmilner.wordpress.com/122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jfrmilner.wordpress.com&amp;blog=9874243&amp;post=122&amp;subd=jfrmilner&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jfrmilner.wordpress.com/2010/11/29/convert-dcs-to-rodcs-in-bulk-using-powershell-part-1-of-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4993cc66e993089a79c293cc48d0d242?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jfrmilner</media:title>
		</media:content>

		<media:content url="http://jfrmilner.files.wordpress.com/2010/11/rodc-gpomaxmempershellmb.jpg" medium="image">
			<media:title type="html">RODC-GPOMaxMemPerShellMB</media:title>
		</media:content>
	</item>
	</channel>
</rss>
