<?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>PeetersOnline &#187; DCOM</title>
	<atom:link href="http://www.peetersonline.nl/index.php/tag/dcom/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peetersonline.nl</link>
	<description>Using Powershell for (virtually) everything!</description>
	<lastBuildDate>Fri, 19 Aug 2011 09:22:19 +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>Fix DCOM Event 10005 with Powershell</title>
		<link>http://www.peetersonline.nl/index.php/powershell/fix-dcom-event-10005-with-powershell/</link>
		<comments>http://www.peetersonline.nl/index.php/powershell/fix-dcom-event-10005-with-powershell/#comments</comments>
		<pubDate>Wed, 19 May 2010 12:57:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[DCOM]]></category>
		<category><![CDATA[Event Log]]></category>
		<category><![CDATA[Registry]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Windows 2003]]></category>

		<guid isPermaLink="false">http://www.peetersonline.nl/?p=428</guid>
		<description><![CDATA[Do you get these events in your system log? The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. attempting to start the service ntmssvc with arguments &#8220;-Service&#8221; in order to run the server: {D61A27C6-8F53-11D0-BFA0-00A024151983} Symantec explains this is caused by disabling the Removable Storage <a href='http://www.peetersonline.nl/index.php/powershell/fix-dcom-event-10005-with-powershell/'>[...]</a>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Do you get these events in your system log?</p>
<blockquote><p>The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. attempting to start the service ntmssvc with arguments &#8220;-Service&#8221; in order to run the server:<br />
{D61A27C6-8F53-11D0-BFA0-00A024151983}</p></blockquote>
<p>Symantec <a href="http://seer.support.veritas.com/docs/240378.htm">explains</a> this is caused by disabling the Removable Storage Manager and <a href="http://seer.entsupport.symantec.com/docs/262914.htm">provides a solution</a>.</p>
<p>Removing those registry keys on a bunch of servers manually is a pain. Modifying DCOM settings even more so. So I explored fixing this with <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" target='_blank'>Powershell</a>.</p>
<p><span id="more-428"></span><br />
Scripting DCOM application settings (COM+ Apllications in dcomcnfg) is doable. See <a href="http://msdn.microsoft.com/en-us/library/ee309561(v=VS.85).aspx">MSDN</a>. However, scripting the DCOM Config section of dcomcnfg appears to be impossible. Turns out all these settings are located in the registry. Clearing the checkbox &#8220;Run application on this computer&#8221; does nothing more then rename one of the values in the registry key you will delete. That&#8217;s one problem down.<br />
So all we have to do is remove the appropriate registry keys on all our affected servers. Remote registry manipulation is something we have done before, so let&#8217;s jump to the script! In order to be able to undo the changes you will make with this script, I recommend you export the following keys on one of your servers:</p>
<blockquote><p>HKLM\Software\Classes\AppID\{D61A27C1-8F53-11D0-BFA0-00A024151983}<br />
HKLM\Software\Classes\CLSID\{D61A27C6-8F53-11D0-BFA0-00A024151983}</p></blockquote>
<p>Here&#8217;s the script:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #0000FF;">function</span> Fix<span style="color: pink;">-</span>RsmDcom
<span style="color: #000000;">&#123;</span>
	<span style="color: #0000FF;">Param</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$ServerName</span> <span style="color: pink;">=</span> <span style="color: #800000;">'blank'</span><span style="color: #000000;">&#41;</span>
&nbsp;
	<span style="color: #0000FF;">If</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$ServerName</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">'blank'</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #800080;">$ServerName</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Read-Host</span> <span style="color: #800000;">&quot;ServerName&quot;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #800080;">$Hive</span> <span style="color: pink;">=</span> <span style="color: #800000;">'LocalMachine'</span>
	<span style="color: #800080;">$AppIDKeyName</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Software\Classes\AppID&quot;</span>
	<span style="color: #800080;">$AppIDSubKey</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;{D61A27C1-8F53-11D0-BFA0-00A024151983}&quot;</span>
	<span style="color: #800080;">$CLSIDKeyName</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Software\Classes\CLSID&quot;</span>
	<span style="color: #800080;">$CLSIDSubKey</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;{D61A27C6-8F53-11D0-BFA0-00A024151983}&quot;</span>
	<span style="color: #800080;">$Writable</span> <span style="color: pink;">=</span> <span style="color: #800080;">$true</span>
&nbsp;
	<span style="color: #008080; font-weight: bold;">Write</span>	<span style="color: pink;">-</span>Host <span style="color: #800000;">&quot;Processing Server $Servername&quot;</span>
&nbsp;
	<span style="color: #800080;">$Registry</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.Win32.RegistryKey<span style="color: #000000;">&#93;</span>::OpenRemoteBaseKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span>Microsoft.Win32.RegistryHive<span style="color: #000000;">&#93;</span>::<span style="color: #800080;">$Hive</span><span style="color: pink;">,</span> <span style="color: #800080;">$ServerName</span><span style="color: #000000;">&#41;</span>
	<span style="color: #0000FF;">If</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$Registry</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #800080;">$AppID</span> <span style="color: pink;">=</span> <span style="color: #800080;">$Registry</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800080;">$AppIDKeyName</span><span style="color: pink;">,</span> <span style="color: #800080;">$Writable</span><span style="color: #000000;">&#41;</span>
		<span style="color: #0000FF;">If</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$AppID</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0000FF;">If</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$AppID</span>.GetSubKeyNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF0000;">-contains</span> <span style="color: #800080;">$AppIDSubKey</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`t</span>Removing AppID subkey&quot;</span>
				<span style="color: #800080;">$AppID</span>.DeleteSubKey<span style="color: #000000;">&#40;</span><span style="color: #800080;">$AppIDSubKey</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0000FF;">Else</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #008080; font-weight: bold;">Write-Warning</span> <span style="color: #800000;">&quot;AppID SubKey not found on $ServerName&quot;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0000FF;">Else</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #008080; font-weight: bold;">Write-Warning</span> <span style="color: #800000;">&quot;Failed to open AppID subkey on $ServerName&quot;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #800080;">$CLSID</span> <span style="color: pink;">=</span> <span style="color: #800080;">$Registry</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800080;">$CLSIDKeyName</span><span style="color: pink;">,</span> <span style="color: #800080;">$Writable</span><span style="color: #000000;">&#41;</span>
		<span style="color: #0000FF;">If</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$CLSID</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0000FF;">If</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$CLSID</span>.GetSubKeyNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF0000;">-contains</span> <span style="color: #800080;">$CLSIDSubKey</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`t</span>Removing CSLID subkey tree&quot;</span>
				<span style="color: #800080;">$CLSID</span>.DeleteSubKeyTree<span style="color: #000000;">&#40;</span><span style="color: #800080;">$CLSIDSubKey</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0000FF;">Else</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #008080; font-weight: bold;">Write-Warning</span> <span style="color: #800000;">&quot;CLSID SubKey not found on $ServerName&quot;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0000FF;">Else</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #008080; font-weight: bold;">Write-Warning</span> <span style="color: #800000;">&quot;Failed to open CLSID subkey on $ServerName&quot;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
	<span style="color: #0000FF;">Else</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-weight: bold;">Write-Warning</span> <span style="color: #800000;">&quot;Failed to connect to registry on $ServerName&quot;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Download it here: <a href='http://www.peetersonline.nl/wp-content/Fix-RsmDcom.txt'>Fix-RsmDcom (rename to .ps1)</a></p>
<p>Enjoy!</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.peetersonline.nl/index.php/powershell/fix-dcom-event-10005-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

