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

<channel>
	<title>Michael Phillips Blog &#187; PowerShell</title>
	<atom:link href="http://nukeitmike.com/blog/tag/powershell/feed" rel="self" type="application/rss+xml" />
	<link>http://nukeitmike.com/blog</link>
	<description>My place to speak about things</description>
	<lastBuildDate>Fri, 03 Feb 2012 22:55:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Launch a PowerShell script minimized</title>
		<link>http://nukeitmike.com/blog/2011/12/28/launch-a-powershell-script-minimized/</link>
		<comments>http://nukeitmike.com/blog/2011/12/28/launch-a-powershell-script-minimized/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 20:45:55 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Citrix]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://nukeitmike.com/blog/?p=299</guid>
		<description><![CDATA[We use Citrix for a lot of applications, and I have a need to launch Outlook, then an application, and then close Outlook when that application is closed by the user.&#160; This seems like a pretty simple thing to do (and I suppose it is, sort of) but it took me a while to figure [...]]]></description>
			<content:encoded><![CDATA[<p>We use Citrix for a lot of applications, and I have a need to launch Outlook, then an application, and then close Outlook when that application is closed by the user.&#160; This seems like a pretty simple thing to do (and I suppose it is, sort of) but it took me a while to figure it out.&#160; </p>
<p>One piece of the puzzle is that PowerShell remains open if you do it the way I have it setup right now.&#160; If the user closes that PowerShell window, then the monitor process will not close Outlook when the user exits the LOB app.&#160; In order to mitigate this issue somewhat, I wanted to start PowerShell minimized.&#160; The way to do this is:</p>
<blockquote><p>powershell -WindowStyle Minimized .\ScriptToRun.ps1</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://nukeitmike.com/blog/2011/12/28/launch-a-powershell-script-minimized//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Powershell to get logon script path from Active Directory</title>
		<link>http://nukeitmike.com/blog/2010/07/29/using-powershell-to-get-logon-script-path-from-active-directory/</link>
		<comments>http://nukeitmike.com/blog/2010/07/29/using-powershell-to-get-logon-script-path-from-active-directory/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 20:57:31 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://nukeitmike.com/blog/2010/07/29/using-powershell-to-get-logon-script-path-from-active-directory/</guid>
		<description><![CDATA[If you want to know what logon script users are getting, this is an easy way to get that information: Import-Module -Name ActiveDirectory Get-ADUser -Filter * -SearchBase &#34;OU=YourOUName,DC=YourDomain,DC=COM&#34; -properties ScriptPath &#124; Export-Csv &#34;c:\script\ADUser.csv&#34; Note: In order for this to work, you have to have the ActiveDirectory Module loaded.&#160;]]></description>
			<content:encoded><![CDATA[<p>If you want to know what logon script users are getting, this is an easy way to get that information:</p>
<blockquote><p>Import-Module -Name ActiveDirectory </p>
<p>Get-ADUser -Filter * -SearchBase &quot;OU=YourOUName,DC=YourDomain,DC=COM&quot; -properties ScriptPath | Export-Csv &quot;c:\script\ADUser.csv&quot;</p>
</blockquote>
<p>Note: In order for this to work, you have to have the ActiveDirectory Module loaded.&#160; </p>
]]></content:encoded>
			<wfw:commentRss>http://nukeitmike.com/blog/2010/07/29/using-powershell-to-get-logon-script-path-from-active-directory//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Not recognized as a cmdlet&#8230;</title>
		<link>http://nukeitmike.com/blog/2010/03/25/not-recognized-as-a-cmdlet/</link>
		<comments>http://nukeitmike.com/blog/2010/03/25/not-recognized-as-a-cmdlet/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 13:07:03 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://nukeitmike.com/blog/2010/03/25/not-recognized-as-a-cmdlet/</guid>
		<description><![CDATA[I have been working on a simple little script to copy a file and then launch a program.&#160; I am sure that there are a lot of ways to do it, but I decided to use PowerShell, and this is what I came up with: $CheckForFile = &#34;H:\custom.ini&#34; $FileToCopy = &#34;c:\IT\custom.ini&#34; $CopyFileTo = &#34;H:\&#34; $PathTest [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on a simple little script to copy a file and then launch a program.&#160; I am sure that there are a lot of ways to do it, but I decided to use PowerShell, and this is what I came up with:</p>
<blockquote><p>$CheckForFile = &quot;H:\custom.ini&quot;     <br />$FileToCopy = &quot;c:\IT\custom.ini&quot;      <br />$CopyFileTo = &quot;H:\&quot; </p>
<p>$PathTest = Test-Path $CheckForFile      <br />If ($PathTest -eq &quot;false&quot;)      <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160; Copy-Item $FileToCopy $CopyFileTo      <br />&#160;&#160;&#160; } </p>
<p>#uses the Invoke-Item command to launch the application     <br />Invoke-Item &quot;C:\Program Files\executable to launch.exe&quot;</p>
</blockquote>
<p>This is for use in a Citrix/Terminal Server environment, so I want to be able to call this script like this: PowerShell copythenlaunch.ps1</p>
<p>When I tested that, I got this:</p>
<blockquote><p>C:\IT&gt;powershell copythenlaunch.ps1     <br />The term &#8216;copythenlaunch.ps1&#8242; is not recognized as a cmdlet, function, operable      <br /> program, or script file. Verify the term and try again.      <br />At line:1 char:18      <br />+ copythenlaunch.ps1 &lt;&lt;&lt;&lt;</p>
</blockquote>
<p>I kept thinking there was some problem with the install of PowerShell (I am running this particular script on a Windows 2003 Server) or that I had some illegal character in the name (it had a number in it originally) or some other simple problem.&#160; Finally I did a search and came across this little bit of conversation:</p>
<blockquote><p>re: Power and Pith<a name="1380970"></a></p>
</blockquote>
<blockquote><p>I just started with PowerShell.</p>
<p>Wanted to run some test scripts from you download.</p>
<p>When I tpye in Beep.ps1 I get &quot;The term &#8216;Beep.1&#8242; is not recognized&#8230;..&quot;</p>
<p>What Am I doing wrong?</p>
<p>Friday, December 29, 2006 3:17 PM by <a>MikeL</a></p>
<h6><a href="http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#1381442">#</a> re: Power and Pith<a name="1381442"></a></h6>
<p>&gt; When I tpye in Beep.ps1 I get &quot;The term &#8216;Beep.1&#8242; is not recognized&#8230;..&quot;</p>
<p>&gt; What Am I doing wrong?</p>
<p>You are relying upon a traditional bad shell behaviour that has been a security nightmere for decades.</p>
<p>In PowerShell, you have to be explicit if you want to run a command in the current directory.&#160; Type &quot;.\beep.ps1&quot;</p>
<p>Jeffrey Snover [MSFT]</p>
<p>Windows PowerShell/MMC Architect</p>
<p>Visit the Windows PowerShell Team blog at:&#160;&#160;&#160; <a href="http://blogs.msdn.com/PowerShell">http://blogs.msdn.com/PowerShell</a></p>
<p>Visit the Windows PowerShell ScriptCenter at:&#160; <a href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx">http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx</a></p>
<p>Friday, December 29, 2006 5:19 PM by <a href="http://blogs.msdn.com/user/Profile.aspx?UserID=29278">PowerShellTeam</a></p>
<h6><a href="http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#1865770">#</a> re: Power and Pith<a name="1865770"></a></h6>
<p><strong>Thank You for supplying the &quot;.\*&quot; information.&#160; I have been racking my brain for almost two days wondering what I was doing wrong.&#160; And to think it was as simple as using the PROPER .\yourscripthere.ps1 format.</strong></p>
<p>Thank you very very much</p>
</blockquote>
<p>Ditto on the thanks…</p>
<p><a href="http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx">Windows PowerShell Blog : Power and Pith</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nukeitmike.com/blog/2010/03/25/not-recognized-as-a-cmdlet//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell Confirm Preference</title>
		<link>http://nukeitmike.com/blog/2010/03/04/powershell-confirm-preference/</link>
		<comments>http://nukeitmike.com/blog/2010/03/04/powershell-confirm-preference/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 03:47:39 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://nukeitmike.com/blog/2010/03/04/powershell-confirm-preference/</guid>
		<description><![CDATA[I seem to run into an issue when I run some PowerShell scripts where I get prompted at each line of the script for confirmation.&#160; That can get really annoying, so I have to look up how to prevent that behavior.&#160; Thankfully, there is already some good information out there on how to do that: [...]]]></description>
			<content:encoded><![CDATA[<p> I seem to run into an issue when I run some PowerShell scripts where I get prompted at each line of the script for confirmation.&#160; That can get really annoying, so I have to look up how to prevent that behavior.&#160; Thankfully, there is already some good information out there on how to do that: </p>
<blockquote><p>When confirmation is turned on by $ConfirmPreference, you can turn it off for any individual cmdlet invocation using &quot;-Confirm:$false&quot;.&#160; You can also use &quot;-Confirm:$false&quot; to turn off default confirmation for high impact cmdlets such as Removing a Mailbox.&#160; Another way to turn off confirmation is by setting $ConfirmPreference to &quot;None&quot;; you can limit the effect by setting $script:ConfirmPreference etc, see &quot;get-help about_scope&quot; for more details.</p>
</blockquote>
<p>For more details and options besides just turning it off, go see the original post:</p>
<p><a href="http://blogs.msdn.com/powershell/archive/2006/12/15/confirmpreference.aspx">Windows PowerShell Blog : ConfirmPreference</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nukeitmike.com/blog/2010/03/04/powershell-confirm-preference//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Servers in Domain</title>
		<link>http://nukeitmike.com/blog/2010/02/24/servers-in-domain/</link>
		<comments>http://nukeitmike.com/blog/2010/02/24/servers-in-domain/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 03:24:25 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://nukeitmike.com/blog/2010/02/24/servers-in-domain-2/</guid>
		<description><![CDATA[At some point, I had a desire to list all the computer accounts for any server OS in Active Directory.  I am pretty sure that I did a search and found the script below, but I don’t remember where, so whoever wrote it doesn’t get credit this time… $strCategory = &#8220;computer&#8221; $strOperatingSystem = &#8220;Windows*Server*&#8221; $objDomain [...]]]></description>
			<content:encoded><![CDATA[<p>At some point, I had a desire to list all the computer accounts for any server OS in Active Directory.  I am pretty sure that I did a search and found the script below, but I don’t remember where, so whoever wrote it doesn’t get credit this time…</p>
<blockquote><p>$strCategory = &#8220;computer&#8221;<br />
$strOperatingSystem = &#8220;Windows*Server*&#8221;</p>
<p>$objDomain = New-Object System.DirectoryServices.DirectoryEntry</p>
<p>$objSearcher = New-Object System.DirectoryServices.DirectorySearcher<br />
$objSearcher.SearchRoot = $objDomain</p>
<p>$objSearcher.Filter = (&#8220;OperatingSystem=$strOperatingSystem&#8221;)</p>
<p>$colProplist = &#8220;name&#8221;<br />
foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)}</p>
<p>$colResults = $objSearcher.FindAll()<br />
Write-Host $colResults.count<br />
foreach ($objResult in $colResults)<br />
    {<br />
    $objComputer = $objResult.Properties;<br />
    $objComputer.name<br />
    }</p></blockquote>
<p>If you change the $strOperatingSystem = “Windows*Server*” to something like $strOperatingSystem = “Windows*”  it will return all computer accounts that have “Windows” in the Name field on the Operating System tab of the properties of the AD object:</p>
<p><a href="http://nukeitmike.com/blog/wp-content/uploads/2010/02/image.png"><img title="image" src="http://nukeitmike.com/blog/wp-content/uploads/2010/02/image_thumb.png" border="0" alt="image" width="644" height="263" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nukeitmike.com/blog/2010/02/24/servers-in-domain//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using XML in your PowerShell scripting</title>
		<link>http://nukeitmike.com/blog/2009/09/22/using-xml-in-your-powershell-scripting/</link>
		<comments>http://nukeitmike.com/blog/2009/09/22/using-xml-in-your-powershell-scripting/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 03:07:19 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://nukeitmike.com/blog/2009/09/22/using-xml-in-your-powershell-scripting/</guid>
		<description><![CDATA[I have written a lot of scripts that use .txt files to read or store data, but I have a need to read some information from an .xml file.  This could be done by treating the file as a simple txt file, but it would require some pretty good filtering that is already a part [...]]]></description>
			<content:encoded><![CDATA[<p>I have written a lot of scripts that use .txt files to read or store data, but I have a need to read some information from an .xml file.  This could be done by treating the file as a simple txt file, but it would require some pretty good filtering that is already a part of the xml file.  A quick search helped me locate this article:</p>
<blockquote><p><a title="http://blogs.msdn.com/kalleb/archive/2008/07/19/using-powershell-to-read-xml-files.aspx" href="http://blogs.msdn.com/kalleb/archive/2008/07/19/using-powershell-to-read-xml-files.aspx">http://blogs.msdn.com/kalleb/archive/2008/07/19/using-powershell-to-read-xml-files.aspx</a></p></blockquote>
<p>Which contained the key to helping me with what I needed to do.  The specific piece I needed was in Lesson 2:</p>
<blockquote><p>Lesson 2:<br />
Read data from an XML-file.<br />
The XML-file that I&#8217;m going to read from has the following structure:<br />
&lt;Users&gt;<br />
  &lt;User&gt;<br />
    &lt;Name&gt;Kalle&lt;/Name&gt;<br />
&lt;/User&gt;<br />
  &lt;User&gt;<br />
    &lt;Name&gt;Becker&lt;/Name&gt;<br />
  &lt;/User&gt;<br />
&lt;/Users&gt;<br />
Reading data from an XML-file is really easy in PowerShell! Use this command to load the file into an variable:<br />
PS C:\Tmp&gt; <em>[xml]$userfile = Get-Content Accounts.xml </em></p>
<p>When the xml-file is loaded you can type <em>&#8220;$userfile.U</em>&#8221; and press tab to get auto completion!! It&#8217;s a breeze.</p></blockquote>
<p>The trick is that you have to actually READ what is in front of you.  The key here is to let PowerShell know that you are reading an xml file, and that is done by placing<strong> [xml]</strong> prior to getting the content.  I missed that the first six times I read this and couldn’t figure out why I wasn’t getting the results I expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://nukeitmike.com/blog/2009/09/22/using-xml-in-your-powershell-scripting//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitoring drive space</title>
		<link>http://nukeitmike.com/blog/2009/09/04/monitoring-drive-space/</link>
		<comments>http://nukeitmike.com/blog/2009/09/04/monitoring-drive-space/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 21:25:29 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[General Info]]></category>
		<category><![CDATA[Operational Excellence]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://nukeitmike.com/blog/2009/09/04/monitoring-drive-space/</guid>
		<description><![CDATA[One of the things that we spend a lot of time on is trying to keep track of what servers have enough free space.&#160; We have a lot of different tools to check drive space, and we even use some of them from time to time.&#160; We have a pretty complicated system created by Rickey [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things that we spend a lot of time on is trying to keep track of what servers have enough free space.&#160; We have a lot of different tools to check drive space, and we even use some of them from time to time.&#160; We have a pretty complicated system created by <a href="http://www.whitworth.org/" target="_blank">Rickey</a> that creates a nice webpage, with highlighting for problem areas (percentage change from day to day, current percent free, etc.)&#160; It even puts the info into a database for historical reporting.</p>
<p>We don’t store or report on VMs currently, mainly because we were trying to keep track of total REAL disk used.&#160; VMs often don’t use as much as they think they do, so that would skew the results, as well as the fact that we are reporting on the hosts.&#160; </p>
<p>All of that is the reason that <a href="http://pburch.com/blog" target="_blank">Patrick</a> asked me to come up with some other tool to use for the VMs so I happened to find a few pieces of PowerShell script that I managed to put together to do a pretty good job of providing some of the info we wanted, and I thought I would share that with the 2 people who read my blog.&#160; <img src='http://nukeitmike.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#160;</p>
<blockquote><p>$servers = Get-Content servers.txt </p>
<p>#Open Excel and create a new workbook and worksheet     <br />$ExcelSheet=New-Object -comobject Excel.application&#160;&#160;&#160; <br />$WorkBook=$ExcelSheet.WorkBooks.add(1)&#160;&#160;&#160;&#160; <br />$WorkSheet=$WorkBook.WorkSheets.item(1)&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p>
<p>#Header row     <br />$WorkSheet.cells.item(1,1)=”Computer Name”&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />$WorkSheet.cells.item(1,2)=”Disk Device ID”&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />$WorkSheet.cells.item(1,3)=”Volume Name”&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />$WorkSheet.cells.item(1,4)=”Size (GB)”&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />$WorkSheet.cells.item(1,5)=”Free Space (GB)”      <br />$WorkSheet.cells.item(1,6)=”Space Used (GB)”      <br />$WorkSheet.cells.item(1,7)=”Percent Used” </p>
<p>$i=2 </p>
<p>ForEach ($ComputerName in $servers)     <br />{&#160;&#160;&#160; <br />&#160;&#160;&#160; echo &quot;Server Name : &quot;, $ComputerName      <br />&#160;&#160;&#160; $Disks = gwmi –computername $ComputerName win32_logicaldisk -filter &quot;drivetype=3&quot; </p>
<p>&#160;&#160;&#160; foreach ($Disk in $Disks)      <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $Size = &quot;{0:0.0}&quot; -f ($Disk.Size/1GB)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $FreeSpace = &quot;{0:0.0}&quot; -f ($Disk.FreeSpace/1GB)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $Used = ([int64]$Disk.size &#8211; [int64]$Disk.freespace)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $SpaceUsed = &quot;{0:0.0}&quot; -f ($Used/1GB)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $Percent = ($Used * 100.0)/$Disk.Size      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $Percent = &quot;{0:N0}&quot; -f $Percent      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $WorkSheet.cells.item($i,1)=$ComputerName      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $WorkSheet.cells.item($i,2)=$Disk.deviceid      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $WorkSheet.cells.item($i,3)=$Disk.volumename      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $WorkSheet.cells.item($i,4)=$Size      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $WorkSheet.cells.item($i,5)=$FreeSpace      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $WorkSheet.cells.item($i,6)=$SpaceUsed      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $WorkSheet.cells.item($i,7)=$Percent </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $i=$i+1&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160; }      <br />}      <br />#Show the results      <br />$ExcelSheet.visible=$true</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://nukeitmike.com/blog/2009/09/04/monitoring-drive-space//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Follow up to the DPM recovery point expiration issues</title>
		<link>http://nukeitmike.com/blog/2009/08/07/follow-up-to-the-dpm-recovery-point-expiration-issues/</link>
		<comments>http://nukeitmike.com/blog/2009/08/07/follow-up-to-the-dpm-recovery-point-expiration-issues/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 13:15:58 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Data Protection Manager]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[System Center]]></category>
		<category><![CDATA[DPM]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://nukeitmike.com/blog/2009/08/07/follow-up-to-the-dpm-recovery-point-expiration-issues/</guid>
		<description><![CDATA[Previously, I blogged about issues I was having where old recovery points were not being expired/removed from my DPM servers.&#160; I had to open a ticket with Microsoft, and worked with them to determine the cause, and since then, they have released a fix. The fix that Microsoft developed is here: http://www.microsoft.com/downloads/details.aspx?FamilyID=aee949aa-d3e7-4b0f-b718-00b7c20f1257&#38;displayLang=en A few people [...]]]></description>
			<content:encoded><![CDATA[<p>Previously, I blogged about issues I was having where old recovery points were not being expired/removed from my DPM servers.&#160; I had to open a ticket with Microsoft, and worked with them to determine the cause, and since then, they have released a fix.</p>
<p>The fix that Microsoft developed is here: <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=aee949aa-d3e7-4b0f-b718-00b7c20f1257&amp;displayLang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=aee949aa-d3e7-4b0f-b718-00b7c20f1257&amp;displayLang=en</a></p>
<p>A few people have asked for the PowerShell script “show-pruneshadowcopies.ps1” that Microsoft provided and I mentioned in my previous post <a href="http://nukeitmike.com/blog/2009/04/12/dpm-does-not-remove-expired-recovery-points/" target="_blank">(here)</a>.&#160; The script looks like this:</p>
<blockquote><p>#displays all RP for data sources and shows which RP&#8217;s would be deleted by the regular pruneshadowcopies.ps1      <br /># Outputs to a logfile:&#160; C:\Program Files\Microsoft DPM\DPM\bin\SHOW-PRUNESHADOWCOPIES.LOG </p>
<p>#Author&#160;&#160;&#160; : Mike J     <br />#Date&#160;&#160;&#160; : 02/24/2009      <br />$version=&quot;V1.0&quot; </p>
<p>$date=get-date     <br />$logfile=&quot;SHOW-PRUNESHADOWCOPIES.LOG.txt&quot; </p>
<p>function GetDistinctDays([Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionGroup] $group,      <br />[Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.Datasource] $ds)      <br />{&#160;&#160;&#160; <br />&#160;&#160;&#160; if($group.ProtectionType -eq [Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionType]::DiskToTape)      <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return 0      <br />&#160;&#160;&#160; }      <br />&#160;&#160;&#160; $scheduleList = get-policyschedule -ProtectionGroup $group -ShortTerm      <br />&#160;&#160;&#160; if($ds -is [Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.FileSystem.FsDataSource])      <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $jobType = [Microsoft.Internal.EnterpriseStorage.Dls.Intent.JobTypeType]::ShadowCopy      <br />&#160;&#160;&#160; }      <br />&#160;&#160;&#160; else      <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $jobType = [Microsoft.Internal.EnterpriseStorage.Dls.Intent.JobTypeType]::FullReplicationForApplication      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if($ds.ProtectionType -eq [Microsoft.Internal.EnterpriseStorage.Dls.Intent.ReplicaProtectionType]::ProtectFromDPM)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return 2      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160; }      <br />&#160;&#160;&#160; write-host&#160;&#160; &quot;Look for jobType $jobType&quot; </p>
<p>&#160;&#160;&#160; foreach($schedule in $scheduleList)     <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; write-host(&quot;schedule jobType {0}&quot; -f $schedule.JobType)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if($schedule.JobType -eq $jobType)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return [Math]::Ceiling(($schedule.WeekDays.Length * $ds.RecoveryRangeinDays) / 7)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160; } </p>
<p>&#160;&#160;&#160; return 0     <br />} </p>
<p>function IsShadowCopyExternal($id)     <br />{      <br />&#160;&#160;&#160; $result = $false; </p>
<p>&#160;&#160;&#160; $ctx = New-Object -Typename Microsoft.Internal.EnterpriseStorage.Dls.DB.SqlContext      <br />&#160;&#160;&#160; $ctx.Open() </p>
<p>&#160;&#160;&#160; $cmd = $ctx.CreateCommand()     <br />&#160;&#160;&#160; $cmd.CommandText = &quot;select COUNT(*) from tbl_RM_ShadowCopy where shadowcopyid = &#8216;$id&#8217;&quot;&#160;&#160; <br />&#160;&#160;&#160; write-host $cmd.CommandText      <br />&#160;&#160;&#160; $countObj = $cmd.ExecuteScalar()      <br />&#160;&#160;&#160; write-host $countObj      <br />&#160;&#160;&#160; if ($countObj -eq 0)      <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $result = $true      <br />&#160;&#160;&#160; }      <br />&#160;&#160;&#160; $cmd.Dispose()      <br />&#160;&#160;&#160; $ctx.Close() </p>
<p>&#160;&#160;&#160; return $result     <br />} </p>
<p>function IsShadowCopyInUse($id)     <br />{      <br />&#160;&#160;&#160; $result = $true; </p>
<p>&#160;&#160;&#160; $ctx = New-Object -Typename Microsoft.Internal.EnterpriseStorage.Dls.DB.SqlContext      <br />&#160;&#160;&#160; $ctx.Open() </p>
<p>&#160;&#160;&#160; $cmd = $ctx.CreateCommand()     <br />&#160;&#160;&#160; $cmd.CommandText = &quot;select ArchiveTaskId, RecoveryJobId from tbl_RM_ShadowCopy where ShadowCopyId = &#8216;$id&#8217;&quot;&#160;&#160; <br />&#160;&#160;&#160; write-host $cmd.CommandText      <br />&#160;&#160;&#160; $reader = $cmd.ExecuteReader()      <br />&#160;&#160;&#160; while($reader.Read())      <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($reader.IsDBNull(0) -and $reader.IsDBNull(1))      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $result = $false      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160; }       <br />&#160;&#160;&#160; $cmd.Dispose()      <br />&#160;&#160;&#160; $ctx.Close() </p>
<p>&#160;&#160;&#160; return $result     <br />} </p>
<p>&quot;**********************************&quot; &gt; $logfile     <br />&quot;Version $version&quot; &gt;&gt; $logfile      <br />get-date &gt;&gt; $logfile </p>
<p>$dpmservername = &amp;&quot;hostname&quot; </p>
<p>$dpmsrv = connect-dpmserver $dpmservername </p>
<p>if (!$dpmsrv)     <br />{      <br />&#160;&#160;&#160; write-host &quot;Unable to connect to $dpmservername&quot;      <br />&#160;&#160;&#160; exit 1      <br />} </p>
<p>write-host $dpmservername     <br />&quot;Selected DPM server = $DPMservername&quot; &gt;&gt; $logfile      <br />$pgList = get-protectiongroup $dpmservername      <br />if (!$pgList)      <br />{      <br />&#160;&#160;&#160; write-host&#160;&#160; &quot;No PGs found&quot;      <br />&#160;&#160;&#160; disconnect-dpmserver $dpmservername      <br />&#160;&#160;&#160; exit 2      <br />} </p>
<p>write-host(&quot;Number of ProtectionGroups = {0}&quot; -f $pgList.Length)     <br />$replicaList = @{}      <br />$latestScDateList = @{} </p>
<p>foreach($pg in $pgList)     <br />{      <br />&#160;&#160;&#160; $dslist = get-datasource $pg      <br />&#160;&#160;&#160; if ($dslist.length -gt 0)      <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160; write-host(&quot;Number of datasources in this PG = {0}&quot; -f $dslist.length)      <br />&#160;&#160;&#160; (&quot;Number of datasources in this PG = {0}&quot; -f $dslist.length) &gt;&gt; $logfile      <br />&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160; Foreach ($ds in $dslist)      <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160; write-host(&quot;DS NAME=&#160; $ds&quot;)      <br />&#160;&#160;&#160;&#160;&#160;&#160; (&quot;DS NAME=&#160; $ds&quot;) &gt;&gt;$logfile      <br />&#160;&#160;&#160; }      <br />&#160;&#160;&#160; foreach ($ds in $dslist)      <br />&#160;&#160;&#160; {&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $rplist = get-recoverypoint $ds | where { $_.DataLocation -eq &#8216;Disk&#8217; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; write-host(&quot;Number of recovery points for $ds {0}&quot; -f $rplist.length)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; (&quot;Number of recovery points for $ds {0}&quot; -f $rplist.length) &gt;&gt;$logfile&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $countDistinctDays = GetDistinctDays $pg $ds      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; write-host(&quot;Number of days with fulls = $countDistinctDays&quot;)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; (&quot;Number of days with fulls = $countDistinctDays&quot;) &gt;&gt;$logfile      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if($countDistinctDays -eq 0)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; write-host&#160;&#160; &quot;D2T PG. No recovery points to delete&quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;D2T PG. No recovery points to delete&quot; &gt;&gt;$logfile       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; continue;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $replicaList[$ds.ReplicaPath] = $ds.RecoveryRangeinDays      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $latestScDateList[$ds.ReplicaPath] = new-object DateTime 0,0      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $lastDayOfRetentionRange = ([DateTime]::UtcNow).AddDays($ds.RecoveryRangeinDays * -1);&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; write-host(&quot;Distinct days to count = {0}. LastDayOfRetentionRange = {1} &quot; -f $countDistinctDays, $lastDayOfRetentionRange)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; (&quot;Distinct days to count = {0}. LastDayOfRetentionRange = {1} &quot; -f $countDistinctDays, $lastDayOfRetentionRange) &gt;&gt;$logfile      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $distinctDays = 0;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $lastDistinctDay = (get-Date).Date      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $numberOfRecoveryPointsDeleted = 0 </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($rplist)     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; foreach ($rp in ($rplist | sort-object -property UtcRepresentedPointInTime -descending))      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($rp)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($rp.UtcRepresentedPointInTime.Date -lt $lastDistinctDay)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $distinctDays += 1      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $lastDistinctDay = $rp.UtcRepresentedPointInTime.Date      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; write-host(&quot; $ds&quot;)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (&quot; $ds&quot;) &gt;&gt;$logfile      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; write-host(&quot;&#160; Recovery Point #$distinctdays RPtime={0}&quot; -f $rp.UtcRepresentedPointInTime)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (&quot;&#160; Recovery Point #$distinctdays RPtime={0}&quot; -f $rp.UtcRepresentedPointInTime) &gt;&gt;$logfile       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (($distinctDays -gt $countDistinctDays) -and ($rp.UtcRepresentedPointInTime -lt $lastDayOfRetentionRange))      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; write-host (&quot;Recovery Point would be deleted ! &#8211; RPtime={0}&quot; -f $rp.UtcRepresentedPointInTime)&#160; -foregroundcolor red      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (&quot;Recovery Point would be deleted ! &#8211; RPtime={0} &lt;&lt;&lt;&lt;&lt;&lt;&lt;&quot; -f $rp.UtcRepresentedPointInTime) &gt;&gt;$logfile      <br />#remove-recoverypoint $rp -ForceDeletion -confirm:$true | out-null      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $numberOfRecoveryPointsDeleted += 1      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; write-host &quot;&#160;&#160;&#160; Recovery point not expired yet&quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;&#160;&#160;&#160; Recovery point not yet expired&quot; &gt;&gt;$logfile      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; write-host &quot;Got a NULL rp&quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;Got a NULL rp&quot; &gt;&gt;$logfile       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; write-host &quot;Number of RPs that would be deleted = $numberOfRecoveryPointsDeleted&quot;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;Number of RPs that would be deleted = $numberOfRecoveryPointsDeleted&quot; &gt;&gt;$logfile&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160; }      <br />} </p>
<p>disconnect-dpmserver $dpmservername     <br />write-host &quot;Exiting from script&quot; </p>
<p>exit </p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://nukeitmike.com/blog/2009/08/07/follow-up-to-the-dpm-recovery-point-expiration-issues//feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DPM does not remove expired recovery points</title>
		<link>http://nukeitmike.com/blog/2009/04/12/dpm-does-not-remove-expired-recovery-points/</link>
		<comments>http://nukeitmike.com/blog/2009/04/12/dpm-does-not-remove-expired-recovery-points/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 03:04:17 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Data Protection Manager]]></category>
		<category><![CDATA[Server 2008]]></category>
		<category><![CDATA[System Center]]></category>
		<category><![CDATA[DPM]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[RAM]]></category>
		<category><![CDATA[recovery points]]></category>

		<guid isPermaLink="false">http://nukeitmike.com/blog/2009/04/12/dpm-does-not-remove-expired-recovery-points/</guid>
		<description><![CDATA[I have been using DPM for about 7 months now.&#160; (I tested with it for a few months before that.)&#160; I never installed 2006, but 2007 seems to be working ok.&#160; I have a few complaints, but I have complaints about all the backup software that I have ever used.&#160; None of it really makes [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using DPM for about 7 months now.&#160; (I tested with it for a few months before that.)&#160; I never installed 2006, but 2007 seems to be working ok.&#160; I have a few complaints, but I have complaints about all the backup software that I have ever used.&#160; None of it really makes me happy.&#160; But on to the story…</p>
<p>I have 3 production DPM servers.&#160; One of them has a large number of protection group members.&#160; 8 Protection Groups, 328 Members.&#160; And that is just to protect 39 computers, but one of the SQL servers has about 150 databases.</p>
<p>I noticed the problem because I kept running out of space on the Recovery Point volumes.&#160; I had a particular 2008 Domain Controller that the system state recovery point volume would have to be extended every couple of days.&#160; I was keeping the recovery points on disk for 5 days, so it finally occurred to me that it should take more that 200 GB to keep 5 days work of recovery points for the system state.&#160; </p>
<p>I called and opened a ticket with Microsoft and we have been working on this for almost 2 months.&#160; So far, the best that I can tell is that the process that clears the old recovery points slowly eats up memory.&#160; This coupled with the fact that I have a lot of PG members, and means that the job frequently fails before it completes.&#160; If the number of recovery points continues to grow, the job that clears them (pruneshadowcopies) takes longer and takes more memory.&#160; This increases the chance that it will fail… </p>
<p>I don’t have a solution to this problem yet, other than a few work-arounds and a way to manually run the process:</p>
<ul>
<li>add more RAM to your DPM Server.&#160; Especially if you are running SQL locally on the box.</li>
<li>reduce the number of PG members.&#160; Fewer members, less recovery points, less chance the prune job will fail.</li>
<li>open the DPM Management Shell (DPM PowerShell) and run “pruneshadowcopies.ps1”.&#160; This will manually run the job that is triggered by DPM at midnight every night.&#160; If you have a lot of recovery points that haven’t been pruned, then this will probably fail (crash) a few times before it finishes.&#160; I have had it run all weekend before and then crash, and I have seen it run for just an hour and then crash.&#160; Keep running it, and it will eventually finish.&#160; </li>
<li>Hope that Microsoft comes up with a real fix soon…</li>
</ul>
<p>To see if you have this problem, there is a version of the pruneshadowcopies script that just shows the recovery points, without actually expiring them.&#160; The tech that I have been working with on my case sent it to me.&#160; </p>
]]></content:encoded>
			<wfw:commentRss>http://nukeitmike.com/blog/2009/04/12/dpm-does-not-remove-expired-recovery-points//feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Preinstall DPM Client</title>
		<link>http://nukeitmike.com/blog/2009/03/25/preinstall-dpm-client/</link>
		<comments>http://nukeitmike.com/blog/2009/03/25/preinstall-dpm-client/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 19:11:12 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Data Protection Manager]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[System Center]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[DPM]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://nukeitmike.com/blog/2009/03/25/preinstall-dpm-client/</guid>
		<description><![CDATA[If you deploy servers from an image, and you would like to install DPM prior to imaging, you can’t just use the install option from the DPM server.&#160; You CAN install the agent manually, and then configure it later.&#160; Copy the latest agent files from C:\Program Files\Microsoft DPM\DPM\Agents\RA and put them somewhere you can get [...]]]></description>
			<content:encoded><![CDATA[<p>If you deploy servers from an image, and you would like to install DPM prior to imaging, you can’t just use the install option from the DPM server.&#160; You CAN install the agent manually, and then configure it later.&#160; </p>
<ol>
<li>Copy the latest agent files from C:\Program Files\Microsoft DPM\DPM\Agents\RA and put them somewhere you can get to them.&#160; </li>
<li>Run the DPMAgentInstaller from the appropriate directory,&#160; amd64\1033 or i386\1033 depending on if you have a x64 or x86 system.</li>
<li>On the Production server (the machine you want to protect) run %PROGRAMFILES%Microsoft data protection manager\dpm\bin\setdpmserver -dpmservername &lt;DPM server name&gt;</li>
<li>On the DPM server, open the DPM Management Shell (the PowerShell interface for DPM) and run attach-productionserver.ps1.&#160; This will ask you for the DPMServer, PSName (the production machine that you want to protect), UserName (an administrator on the client machine), Password, and Domain.</li>
<li>Refresh the view in the DPM administrator console.</li>
</ol>
<p>You should see your production servers listed in the Managemt\Agents view.</p>
]]></content:encoded>
			<wfw:commentRss>http://nukeitmike.com/blog/2009/03/25/preinstall-dpm-client//feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

