<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Richard Siddaway's Blog - All Comments</title><link>http://msmvps.com/blogs/richardsiddaway/default.aspx</link><description>Of PowerShell and Other Things</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>re: AD MoL Chapter 10 MEAP</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2013/05/08/ad-mol-chapter-10-meap.aspx#1829875</link><pubDate>Fri, 10 May 2013 16:23:16 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1829875</guid><dc:creator>kl</dc:creator><description>&lt;p&gt;gg&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1829875" width="1" height="1"&gt;</description></item><item><title>re: IE history to CSV</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2011/06/29/ie-history-to-csv.aspx#1827594</link><pubDate>Wed, 17 Apr 2013 10:34:21 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1827594</guid><dc:creator>VasekB vaclav.berounsky@tiscali.cz</dc:creator><description>&lt;p&gt;- function get-iehistory &lt;/p&gt;
&lt;p&gt;add &amp;quot;Title&amp;quot; to foreach { $visit &amp;nbsp;... }:&lt;/p&gt;
&lt;p&gt; Title = $( $pageFolder.GetDetailsOf($_,1))&lt;/p&gt;
&lt;p&gt;I wrote &amp;quot;Graphics interpretation&amp;quot; of data taken by your script&lt;/p&gt;
&lt;p&gt;- run PS&amp;gt;get-iehistory.ps1 | export-csv -Path &amp;#39;C:\ieh.csv&amp;#39; -NoTypeInformation -Delimiter &amp;quot;;&amp;quot; -Encoding &amp;#39;UTF8&amp;#39;&lt;/p&gt;
&lt;p&gt;- run PS&amp;gt;get-iehistory-Graph.ps1&lt;/p&gt;
&lt;p&gt;get-iehistory-Graph.ps1&lt;/p&gt;
&lt;p&gt;Clear-Host&lt;/p&gt;
&lt;p&gt;# Load Assembly&lt;/p&gt;
&lt;p&gt;[Reflection.Assembly]::LoadWithPartialName(&amp;quot;System.Windows.Forms&amp;quot;) | Out-Null&lt;/p&gt;
&lt;p&gt;[Reflection.Assembly]::LoadWithPartialName(&amp;quot;System.Windows.Forms.DataVisualization&amp;quot;) | Out-Null&lt;/p&gt;
&lt;p&gt;# Create ChartArea&lt;/p&gt;
&lt;p&gt;$ChartArea = New-Object System.Windows.Forms.DataVisualization.Charting.ChartArea&lt;/p&gt;
&lt;p&gt;$ChartArea.Area3DStyle.Enable3D = $false&lt;/p&gt;
&lt;p&gt;# X&lt;/p&gt;
&lt;p&gt;$ChartArea.AxisX.Title = &amp;quot;X - URL&amp;quot;					# jmeno osy&lt;/p&gt;
&lt;p&gt;$ChartArea.AxisX.Interval = 1							# jak casto je cara&lt;/p&gt;
&lt;p&gt;$ChartArea.AxisX.IntervalOffset = 0						# posun cislovani osy&lt;/p&gt;
&lt;p&gt;$ChartArea.AxisX.LabelStyle.Interval = 1				# jak casto je popis&lt;/p&gt;
&lt;p&gt;#$ChartArea.AxisY.LabelStyle.Format = &amp;#39;&amp;#39;				# viz $Chart.Series[&amp;quot;Data&amp;quot;].XValueType&lt;/p&gt;
&lt;p&gt;$ChartArea.AxisY.LabelStyle.IsEndLabelVisible = $true	# vypisovat prvni-posledni&lt;/p&gt;
&lt;p&gt;# Y&lt;/p&gt;
&lt;p&gt;$ChartArea.AxisY.Title = &amp;quot;Y - čas&amp;quot;						# jmeno osy&lt;/p&gt;
&lt;p&gt;$ChartArea.AxisY.Interval = 1	 						# jak casto je cara&lt;/p&gt;
&lt;p&gt;$ChartArea.AxisY.IntervalOffset = 0						# posun cislovani osy&lt;/p&gt;
&lt;p&gt;$ChartArea.AxisY.LabelStyle.Interval = 1				# jak casto je popis&lt;/p&gt;
&lt;p&gt;$ChartArea.AxisY.LabelStyle.Format = &amp;#39;yyyy-MM-dd HH:m&amp;#39;	# format datumu, viz $Chart.Series[&amp;quot;Data&amp;quot;].YValueType&lt;/p&gt;
&lt;p&gt;$ChartArea.AxisY.LabelStyle.IsEndLabelVisible = $true	# vypisovat prvni-posledni&lt;/p&gt;
&lt;p&gt;# zoom, scroll&lt;/p&gt;
&lt;p&gt;$ChartArea.CursorX.IsUserEnabled = $true&lt;/p&gt;
&lt;p&gt;$ChartArea.CursorX.IsUserSelectionEnabled = $true&lt;/p&gt;
&lt;p&gt;$ChartArea.CursorY.IsUserEnabled = $true&lt;/p&gt;
&lt;p&gt;$ChartArea.CursorY.IsUserSelectionEnabled = $true&lt;/p&gt;
&lt;p&gt;# object Graphic&lt;/p&gt;
&lt;p&gt;$Chart = New-object System.Windows.Forms.DataVisualization.Charting.Chart &lt;/p&gt;
&lt;p&gt;$Chart.Anchor = [System.Windows.Forms.AnchorStyles]::Bottom -bor [System.Windows.Forms.AnchorStyles]::Right -bor [System.Windows.Forms.AnchorStyles]::Top -bor [System.Windows.Forms.AnchorStyles]::Left&lt;/p&gt;
&lt;p&gt;# $Chart.Width = 500&lt;/p&gt;
&lt;p&gt;# $Chart.Height = 500&lt;/p&gt;
&lt;p&gt;$Chart.Left = 0&lt;/p&gt;
&lt;p&gt;$Chart.Top = 0&lt;/p&gt;
&lt;p&gt;$Chart.ChartAreas.Add($ChartArea)&lt;/p&gt;
&lt;p&gt;$Chart.chartAreas[0].AxisX.LabelStyle.Font = new-object system.drawing.font(&amp;quot;Courier New&amp;quot;,10,[system.drawing.fontstyle]::Regular)&lt;/p&gt;
&lt;p&gt;$Chart.chartAreas[0].AxisY.LabelStyle.Angle = 90&lt;/p&gt;
&lt;p&gt;# Change the color of the text box&lt;/p&gt;
&lt;p&gt;# BackColor: A choice of colors&lt;/p&gt;
&lt;p&gt;$Chart.BackColor = [System.Drawing.Color]::White &lt;/p&gt;
&lt;p&gt;# Palette: None,Bright,Grayscale,Excel,Light,Pastel,EarthTones,SemiTransparent,Berry,Chocolate,Fire,SeaGreen,BrightPastel &lt;/p&gt;
&lt;p&gt;$Chart.Palette = [System.Windows.Forms.DataVisualization.Charting.ChartColorPalette]::Excel &lt;/p&gt;
&lt;p&gt;# Adding Title and Labels&lt;/p&gt;
&lt;p&gt;[void]$Chart.Titles.Add(&amp;quot;Graf&amp;quot;)&lt;/p&gt;
&lt;p&gt;$Chart.Titles[0].Font = &amp;#39;Arial,10pt&amp;#39;&lt;/p&gt;
&lt;p&gt;$Chart.Titles[0].Alignment = &amp;#39;topCenter&amp;#39;&lt;/p&gt;
&lt;p&gt;# Adding Data in Chart&lt;/p&gt;
&lt;p&gt;[void]$Chart.Series.Add(&amp;quot;Data&amp;quot;)&lt;/p&gt;
&lt;p&gt;# The data Chart&lt;/p&gt;
&lt;p&gt;$Chart.Series[&amp;quot;Data&amp;quot;].Sort([System.Windows.Forms.DataVisualization.Charting.PointSortOrder]::Ascending, &amp;quot;Y&amp;quot;) &lt;/p&gt;
&lt;p&gt;# Applicable chart elements: Series, DataPoint&lt;/p&gt;
&lt;p&gt;# Value range: Cylinder, Emboss, LightToDark, Wedge, Default&lt;/p&gt;
&lt;p&gt;$Chart.Series[&amp;quot;Data&amp;quot;][&amp;quot;DrawingStyle&amp;quot;] = &amp;quot;Default&amp;quot;&lt;/p&gt;
&lt;p&gt;# Series.ChartType: Point, FastPoint, Bubble, Line, Spline, StepLine, FastLine, Bar, StackedBar, StackedBar100, Column, StackedColumn, &lt;/p&gt;
&lt;p&gt;#					StackedColumn100,Area, SplineArea, StackedArea, StackedArea100, Pie, Doughnut, Stock, Candlestick, Range, SplineRange, &lt;/p&gt;
&lt;p&gt;#					RangeBar, RangeColumn, Radar,Polar, ErrorBar, BoxPlot, Renko, ThreeLineBreak, Kagi, PointAndFigure, Funnel, Pyramid &lt;/p&gt;
&lt;p&gt;$Chart.Series[&amp;quot;Data&amp;quot;].ChartType = [System.Windows.Forms.DataVisualization.Charting.SeriesChartType]::RangeBar&lt;/p&gt;
&lt;p&gt;# Chart ValueType - LabelStyle.Format&lt;/p&gt;
&lt;p&gt;$Chart.Series[&amp;quot;Data&amp;quot;].XValueType = [System.Windows.Forms.DataVisualization.Charting.ChartValueType]::String&lt;/p&gt;
&lt;p&gt;$Chart.Series[&amp;quot;Data&amp;quot;].YValueType = [System.Windows.Forms.DataVisualization.Charting.ChartValueType]::DateTime&lt;/p&gt;
&lt;p&gt;# nacteni dat&lt;/p&gt;
&lt;p&gt;# cesta k LogStatus-Debug.csv nebo Log_LogStatusDebug-SaveToLocal.csv&lt;/p&gt;
&lt;p&gt;$logPath = &amp;#39;C:\Users\user\SkyDrive\Vasek\IE\ieh.csv&amp;#39;&lt;/p&gt;
&lt;p&gt;# CSV file DateTime format&lt;/p&gt;
&lt;p&gt;$Culture = [System.Globalization.CultureInfo]::GetCultureInfo(&amp;quot;en-us&amp;quot;)&lt;/p&gt;
&lt;p&gt;$FormatString = &amp;#39;dd.MM.yyyy HH:mm&amp;#39;&lt;/p&gt;
&lt;p&gt;# find the oldest and the newest record&lt;/p&gt;
&lt;p&gt;$log = Import-Csv -Delimiter &amp;#39;;&amp;#39; -Path $logPath | Sort-Object @{expression={$_.Date -as [DateTime]}}&lt;/p&gt;
&lt;p&gt;$index = 0&lt;/p&gt;
&lt;p&gt;$Value = $log[$index].Date&lt;/p&gt;
&lt;p&gt;$Value&lt;/p&gt;
&lt;p&gt;[DateTime]$LogStop = [System.DateTime]::ParseExact($Value,$FormatString,$Culture)&lt;/p&gt;
&lt;p&gt;$Value = $log[$log.Count-1].Date&lt;/p&gt;
&lt;p&gt;[DateTime]$LogStart = [System.DateTime]::ParseExact($Value,$FormatString,$Culture)&lt;/p&gt;
&lt;p&gt;[DateTime]$LogStop&lt;/p&gt;
&lt;p&gt;[DateTime]$LogStart&lt;/p&gt;
&lt;p&gt;# sort graph by URL&lt;/p&gt;
&lt;p&gt;$log = Import-Csv -Delimiter &amp;#39;;&amp;#39; -Path $logPath | Sort-Object -Property &amp;#39;Site&amp;#39;&lt;/p&gt;
&lt;p&gt;# sort graph by DATE&lt;/p&gt;
&lt;p&gt;# $log = Import-Csv -Delimiter &amp;#39;;&amp;#39; -Path $logPath | Sort-Object @{expression={$_.Date -as [DateTime]}}&lt;/p&gt;
&lt;p&gt;[hashtable]$StartStop = @{}&lt;/p&gt;
&lt;p&gt;[hashtable]$label = @{}&lt;/p&gt;
&lt;p&gt;[hashtable]$legend = @{}&lt;/p&gt;
&lt;p&gt;[int]$labelId = 0&lt;/p&gt;
&lt;p&gt;[int]$TotalTime = 0&lt;/p&gt;
&lt;p&gt;foreach ($line in $log) {&lt;/p&gt;
&lt;p&gt;	# &amp;quot;Date&amp;quot;;&amp;quot;Title&amp;quot;;&amp;quot;Site&amp;quot;;&amp;quot;URL&amp;quot;&lt;/p&gt;
&lt;p&gt;	# $line.Date + &amp;quot;;&amp;quot; + $line.Index + &amp;quot;;&amp;quot; + $line.ScriptFile + &amp;quot;;&amp;quot; + $line.Type + &amp;quot;;&amp;quot; + $line.Period + &amp;quot;;&amp;quot; + $line.COMPUTERNAME&lt;/p&gt;
&lt;p&gt;	$Value = $line.Date&lt;/p&gt;
&lt;p&gt;	$startTime = [System.DateTime]::ParseExact($Value,$FormatString,$Culture)&lt;/p&gt;
&lt;p&gt;	$stopTime = $startTime.AddMinutes(1)&lt;/p&gt;
&lt;p&gt;	$TotalTime += 1&lt;/p&gt;
&lt;p&gt;	# if domain is not in label-list yet, &amp;nbsp;add to Label X&lt;/p&gt;
&lt;p&gt;	## $labelName = $($line.Site +&amp;#39; # &amp;#39;+ $line.Title).ToString()&lt;/p&gt;
&lt;p&gt;	$labelName = $($line.Site +&amp;#39; # &amp;#39;).ToString()&lt;/p&gt;
&lt;p&gt;	if ($label.ContainsKey($labelName)) {&lt;/p&gt;
&lt;p&gt;		# exist in Label-list, get Label ID&lt;/p&gt;
&lt;p&gt;		$labelId = $label.Get_Item($labelName)&lt;/p&gt;
&lt;p&gt;	} else {&lt;/p&gt;
&lt;p&gt;		# new Label, add Label ID and Name&lt;/p&gt;
&lt;p&gt;		$labelId = $label.Count +1&lt;/p&gt;
&lt;p&gt;		$label.Add($labelName, $labelId)&lt;/p&gt;
&lt;p&gt;	}&lt;/p&gt;
&lt;p&gt;	# draw point&lt;/p&gt;
&lt;p&gt;	[void]$Chart.Series[&amp;quot;Data&amp;quot;].Points.AddXY($labelId, $startTime, $stopTime)&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;# transform [hashtable]$label to [hashtable]$legend ($label.$labelName=$labelId ==&amp;gt; $legend.Id=$labelName)&lt;/p&gt;
&lt;p&gt;foreach ($labelKey in $label.Keys){&lt;/p&gt;
&lt;p&gt;	$legend.Add($label.get_Item($labelKey).ToString(), $labelKey)&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;# X axis legend &lt;/p&gt;
&lt;p&gt;foreach ($bod in $Chart.Series[&amp;quot;Data&amp;quot;].Points) {&lt;/p&gt;
&lt;p&gt;	# $bod.AxisLabel = $legend.Get_Item($($bod.XValue).ToString())&lt;/p&gt;
&lt;p&gt;	$temp = $legend.Get_Item($($bod.XValue).ToString())&lt;/p&gt;
&lt;p&gt;	$bod.AxisLabel = $temp -replace &amp;#39;#&amp;#39;,$(&amp;#39; &amp;#39; * (65-$temp.Split(&amp;#39;#&amp;#39;)[0].Length-$temp.Split(&amp;#39;#&amp;#39;)[1].Length))&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;# Displays the graph in the Windows Form&lt;/p&gt;
&lt;p&gt;$Form = New-Object Windows.Forms.Form &lt;/p&gt;
&lt;p&gt;$Form.Text = &amp;quot;PowerShell – Microsoft Chart Control&amp;quot; &lt;/p&gt;
&lt;p&gt;# $Form.Width = $FormWidth&lt;/p&gt;
&lt;p&gt;# $Form.Height = $FormHeight&lt;/p&gt;
&lt;p&gt;$Form.WindowState = [System.Windows.Forms.FormWindowState]&amp;#39;Maximized&amp;#39;&lt;/p&gt;
&lt;p&gt;$Form.Controls.Add($Chart) &lt;/p&gt;
&lt;p&gt;$Form.Add_Shown({$Form.Activate()}) &lt;/p&gt;
&lt;p&gt;$Form.ShowDialog()&lt;/p&gt;
&lt;p&gt;$($TotalTime / $(New-TimeSpan -Start $LogStop -End $LogStart).Days / 60)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1827594" width="1" height="1"&gt;</description></item><item><title>re: Find user accounts that are disabled</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2012/02/04/find-user-accounts-that-are-disabled.aspx#1826850</link><pubDate>Mon, 08 Apr 2013 21:27:45 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1826850</guid><dc:creator>Rossell</dc:creator><description>&lt;p&gt;Excelent post, congratulations!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1826850" width="1" height="1"&gt;</description></item><item><title>re: AD Management in a Month of Lunches</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2013/04/06/ad-management-in-a-month-of-lunches.aspx#1826738</link><pubDate>Sun, 07 Apr 2013 04:42:45 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1826738</guid><dc:creator>Wayne</dc:creator><description>&lt;p&gt;thank you&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1826738" width="1" height="1"&gt;</description></item><item><title>re: Putting the date in a file name</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2013/04/03/putting-the-date-in-a-file-name.aspx#1826690</link><pubDate>Sat, 06 Apr 2013 09:18:46 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1826690</guid><dc:creator>Vincent</dc:creator><description>&lt;p&gt;To solve that &amp;quot;2step&amp;quot; problem following use could be used.&lt;/p&gt;
&lt;p&gt;&amp;quot;c:\folder\Prefix_$((Get-Date).ToString(&amp;quot;s&amp;quot;).Replace(&amp;quot;:&amp;quot;,&amp;quot;-&amp;quot;)).txt&amp;quot;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1826690" width="1" height="1"&gt;</description></item><item><title>re: Putting the date in a file name</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2013/04/03/putting-the-date-in-a-file-name.aspx#1826522</link><pubDate>Thu, 04 Apr 2013 11:48:10 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1826522</guid><dc:creator>Vadims Podans</dc:creator><description>&lt;p&gt;Another (easier) way is to use -Format parameter in the Get-Date cmdlet:&lt;/p&gt;
&lt;p&gt;Cet-Date -Format dd-MM-yyyyThh-mm-ss&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1826522" width="1" height="1"&gt;</description></item><item><title>re: Putting the date in a file name</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2013/04/03/putting-the-date-in-a-file-name.aspx#1826498</link><pubDate>Wed, 03 Apr 2013 21:59:07 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1826498</guid><dc:creator>BernhardW</dc:creator><description>&lt;p&gt;If you want to get this work with one line you can use it that way...&lt;/p&gt;
&lt;p&gt;$file = &amp;quot;c:\folder\Prefix_$((Get-Date).ToString(&amp;quot;s&amp;quot;).Replace(&amp;quot;:&amp;quot;,&amp;quot;-&amp;quot;)).txt&amp;quot;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1826498" width="1" height="1"&gt;</description></item><item><title>re: MVP renewal 2013</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2013/04/01/mvp-renewal-2013.aspx#1826387</link><pubDate>Tue, 02 Apr 2013 10:01:05 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1826387</guid><dc:creator>Peter Kriegel</dc:creator><description>&lt;p&gt;Congratulation !&lt;/p&gt;
&lt;p&gt;Well earned honor!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1826387" width="1" height="1"&gt;</description></item><item><title>re: WMI LIKEs Wildcards</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2011/12/12/wmi-likes-wildcards.aspx#1825832</link><pubDate>Mon, 25 Mar 2013 15:56:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1825832</guid><dc:creator>Mr_Latein</dc:creator><description>&lt;p&gt;Thank you so much :-)&lt;/p&gt;
&lt;p&gt;You made my day..&lt;/p&gt;
&lt;p&gt;IT WORKS :D&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1825832" width="1" height="1"&gt;</description></item><item><title>re: Finding Domain Controllers</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2012/01/20/finding-domain-controllers.aspx#1825786</link><pubDate>Sun, 24 Mar 2013 17:52:41 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1825786</guid><dc:creator>Maria</dc:creator><description>&lt;p&gt;In case it helps someone else, I figured out how to record the DC that is used by a DirectorySearcher. Don&amp;#39;t let the searcher connect to the remote domain but instead connect to the remote domain *before* creating the searcher, like this:&lt;/p&gt;
&lt;p&gt;$rootDSE = [ADSI] &amp;quot;LDAP://$DnsDomainName/RootDSE&amp;quot;&lt;/p&gt;
&lt;p&gt;$defaultDC = $rootDSE.PSBase.Properties.dnsHostName.Value.ToString()&lt;/p&gt;
&lt;p&gt;Write-Host &amp;quot;DC used by the searcher: $defaultDC&amp;quot;&lt;/p&gt;
&lt;p&gt;$searcher = [adsisearcher] $root&lt;/p&gt;
&lt;p&gt;etc.&lt;/p&gt;
&lt;p&gt;If the default DC happens to be the one that keeps failing with &amp;quot;more data is available&amp;quot; errors, it is now possible to get the list of DCs for the remote domain and pick a different one for use by the searcher.&lt;/p&gt;
&lt;p&gt;$context = new-object System.DirectoryServices.ActiveDirectory.DirectoryContext(&amp;#39;domain&amp;#39;, $DnsDomainName)&lt;/p&gt;
&lt;p&gt;$domain = [system.directoryservices.activedirectory.Domain]::GetDomain($context)&lt;/p&gt;
&lt;p&gt;$DCs = $domain.DomainControllers&lt;/p&gt;
&lt;p&gt;etc.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1825786" width="1" height="1"&gt;</description></item><item><title>re: Testing the computer secure channel</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2012/03/15/testing-the-computer-secure-channel.aspx#1825665</link><pubDate>Fri, 22 Mar 2013 17:21:19 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1825665</guid><dc:creator>ESP</dc:creator><description>&lt;p&gt;From my Win7 system I can run “test-computersecurechannel –server xxxx.xxxxx.com” against any DC in my environment and have it return TRUE (2003 or 2008). If I run that command from my Win7 against any Win2008 DC that is housing the PDC, I get the “The specified domain either does not exist or could not be contacted”. Is that normal ?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1825665" width="1" height="1"&gt;</description></item><item><title>re: New book</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2013/02/25/new-book.aspx#1824323</link><pubDate>Tue, 26 Feb 2013 20:47:07 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1824323</guid><dc:creator>Marko</dc:creator><description>&lt;p&gt;Exelent!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1824323" width="1" height="1"&gt;</description></item><item><title>re: New book</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2013/02/25/new-book.aspx#1824322</link><pubDate>Tue, 26 Feb 2013 20:46:45 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1824322</guid><dc:creator>Marko</dc:creator><description>&lt;p&gt;Exelent&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1824322" width="1" height="1"&gt;</description></item><item><title>re: CIM cmdlets and remote access</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2013/02/18/cim-cmdlets-and-remote-access.aspx#1824038</link><pubDate>Wed, 20 Feb 2013 11:51:16 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1824038</guid><dc:creator>John</dc:creator><description>&lt;p&gt;Hi Richard,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m still very much a beginner so don&amp;#39;t completly understand all of your blog post, but I have a question, actually 2. &lt;/p&gt;
&lt;p&gt;None of the servers we use have PS v3 installed but I have PS v3 running on my desktop. Rather than using a work around would I be better to just use PS v2? If this is correct, if I want to still use PS v3 is it possible to have PS v3 &amp;amp; v2 installed on my desktop?&lt;/p&gt;
&lt;p&gt;If I&amp;#39;ve copletely misunderstood your blog post please accept my apologies.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;John.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1824038" width="1" height="1"&gt;</description></item><item><title>re: Unlocking AD accounts</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2012/02/05/unlocking-ad-accounts.aspx#1823253</link><pubDate>Tue, 29 Jan 2013 21:08:42 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1823253</guid><dc:creator>sami</dc:creator><description>&lt;p&gt;thanks&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1823253" width="1" height="1"&gt;</description></item><item><title>PowerShell and Active Directory–reminder</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2013/01/16/uk-powershell-group-29-january-2013.aspx#1823209</link><pubDate>Mon, 28 Jan 2013 18:21:08 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1823209</guid><dc:creator>Richard Siddaway's Blog</dc:creator><description>&lt;p&gt;Quick reminder for tomorrow’s session from the UK PowerShell group.&amp;#160; Details from: &lt;a rel="nofollow" target="_new" href="http://msmvps"&gt;http://msmvps&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1823209" width="1" height="1"&gt;</description></item><item><title>PowerShell and Active Directory–reminder</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2013/01/16/uk-powershell-group-29-january-2013.aspx#1823208</link><pubDate>Mon, 28 Jan 2013 18:16:15 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1823208</guid><dc:creator>Richard Siddaway's Blog</dc:creator><description>&lt;p&gt;Quick reminder for tomorrow’s session from the UK PowerShell group.&amp;#160; Details from: &lt;a rel="nofollow" target="_new" href="http://msmvps"&gt;http://msmvps&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1823208" width="1" height="1"&gt;</description></item><item><title>re: Authentication, Impersonation and Privileges</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2011/08/04/authentication-impersonation-and-privileges.aspx#1822828</link><pubDate>Fri, 18 Jan 2013 10:23:39 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1822828</guid><dc:creator>RichardSiddaway</dc:creator><description>&lt;p&gt;Just a thought. &amp;nbsp;When you specified the credential for the remote machine did you explicitly put the remote machine in as the domain. &amp;nbsp;If you didn&amp;#39;t get-credential takes your domain.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1822828" width="1" height="1"&gt;</description></item><item><title>re: PowerShell v3 installed modules</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2012/12/14/powershell-v3-installed-modules.aspx#1822756</link><pubDate>Wed, 16 Jan 2013 21:50:04 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1822756</guid><dc:creator>Guy Thomas</dc:creator><description>&lt;p&gt;A great explanation. &amp;nbsp;I even tried naively copying the \modules folder from Windows 8. &amp;nbsp;The cmdlets arrived in Windows 7, but gave an invalid namespace error.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1822756" width="1" height="1"&gt;</description></item><item><title>re: Authentication, Impersonation and Privileges</title><link>http://msmvps.com/blogs/richardsiddaway/archive/2011/08/04/authentication-impersonation-and-privileges.aspx#1822712</link><pubDate>Wed, 16 Jan 2013 13:59:08 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1822712</guid><dc:creator>Jonathan</dc:creator><description>&lt;p&gt;Hi There&lt;/p&gt;
&lt;p&gt;I am running a script that works perfectly against all other boxes except Server 2008 R2.&lt;/p&gt;
&lt;p&gt;I have tried your suggestions and nothing seems to work&lt;/p&gt;
&lt;p&gt;Here is the code:&lt;/p&gt;
&lt;p&gt;gwmi win32_service -ComputerName $Server -credential $cred -Authentication PacketPrivacy -Imperson&lt;/p&gt;
&lt;p&gt;ation Impersonate | Where-Object {$_.name -like &amp;quot;*sql*&amp;quot;}&lt;/p&gt;
&lt;p&gt;The error returned is:&lt;/p&gt;
&lt;p&gt;Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))&lt;/p&gt;
&lt;p&gt;At line:1 char:5&lt;/p&gt;
&lt;p&gt;+ gwmi &amp;lt;&amp;lt;&amp;lt;&amp;lt; &amp;nbsp;win32_service -ComputerName $Server -credential $cred -Authentication PacketPrivacy -Impersonation Impers&lt;/p&gt;
&lt;p&gt;onate | Where-Object {$_.name -like &amp;quot;*sql*&amp;quot;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ CategoryInfo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: NotSpecified: (:) [Get-WmiObject], UnauthorizedAccessException&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetWmiObjectCommand&lt;/p&gt;
&lt;p&gt;I am using a credential object for authentication and the user in my credential object is in the Local Admin group. (It is also a local machine account, not domain account)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1822712" width="1" height="1"&gt;</description></item></channel></rss>