﻿<?xml version="1.0" encoding="UTF-8"?>
<!--RSS generated by Windows SharePoint Services V3 RSS Generator on 9/6/2010 11:38:55 AM-->
<?xml-stylesheet type="text/xsl" href="/blog/_layouts/RssXslt.aspx?List=744536f4-127e-4c4a-bcff-b85408e7e7e5" version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Brain Dump: Posts</title>
    <link>http://www.cjvandyk.com/blog/Lists/Posts/AllPosts.aspx</link>
    <description>RSS feed for the Posts list.</description>
    <lastBuildDate>Mon, 06 Sep 2010 15:38:55 GMT</lastBuildDate>
    <generator>Windows SharePoint Services V3 RSS Generator</generator>
    <ttl>60</ttl>
    <image>
      <title>Cornelius J. van Dyk's SharePoint Brain Dump: Posts</title>
      <url>/blog/Lists/Photos/TheBrainSmall.jpg</url>
      <link>http://www.cjvandyk.com/blog/Lists/Posts/AllPosts.aspx</link>
    </image>
    <item>
      <title>How do I - Resolve the failure to load a module into PowerShell when using the Import-Module cmdlet</title>
      <link>http://www.cjvandyk.com/blog/Lists/Posts/ViewPost.aspx?ID=287</link>
      <description><![CDATA[<div><b>Body:</b> <div class=ExternalClass614D9B0F1192437C98DE4FA4E7A22B82><p align=justify>If you've ventured into the world of PowerShell extensions and modules, and more specifically, that world, targeted at SharePoint, then you have probably run into this error before.</p> <blockquote> <p><font face="Courier New" color="#ff0000" size=2>Import-Module : Could not load file or assembly 'file:///C:\cjvandyk.SharePoint.PowerShell.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. At line:1 char:14+ import-module &lt;&lt;&lt;&lt; .\cjvandyk.SharePoint.PowerShell.dll + CategoryInfo: NotSpecified: (:) [Import-Module], BadImageFormatException + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.ImportModuleCommand</font></p></blockquote> <p align=justify>This error is thrown by PowerShell when you are using the Import-Module cmdlet to import a PowerShell module (redundant, isn't it?) that was built using the .NET Framework 4.0.  The ugly error looks like this:</p> <p><img title=image style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px" height=135 alt=image src="/blog/Lists/Posts/Attachments/287/image_3_5D53F350.png" width=650 border=0> </p> <p align=justify>If you're trying to use that module on a SharePoint system, the odds are that the server does NOT have the 4.0 version of the Framework installed.  You can easily confirm this by simply checking the sub folders under the <strong><font color="#008000">C:\Windows\Microsoft.NET\Framework</font></strong> location.</p> <p> <img title=image style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px" height=225 alt=image src="/blog/Lists/Posts/Attachments/287/image_9_5D53F350.png" width=332 border=0> </p> <p></p> <p align=justify>In the above example, you can see that 1.0, 1.1, 2.0, 3.0, 3.5 and 4.0 are all installed on the server.  If you find that 4.0 is NOT installed, you can quickly install it following this guide.</p> <p align=justify>Once it's installed you only have one more thing left to do.  By default, PowerShell will run under the 2.0 Framework.  We need to force it to default to the 4.0 Framework and only revert back to 2.0 if it doesn't find what it's looking for in 4.0.</p> <p align=left>That is easily done using a .config file for the PowerShell executable.  Browse to the <strong><font color="#008000">C:\Windows\System32\WindowsPowerShell\v1.0</font></strong> location.</p> <p align=justify><img title=image style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px" height=434 alt=image src="/blog/Lists/Posts/Attachments/287/image_12_5D53F350.png" width=379 border=0> </p> <p align=justify>You may not have the two .config file on your system.  If you don't, you need to create them manually.  Name the files exactly the same as the .exe files, but with a .config extension at the back.  Create them as text files, but you will need to show extensions from your Folder Options in Windows Explorer in order to get rid of the .txt extension.  The two config files should be named &quot;PowerShell.exe.config&quot; and &quot;PowerShell_ise.exe.config&quot;.  The content of the two files is a simple XML snippet that simply points PowerShell to default to 4.0 and fallback to 2.0.  Copy and paste the following snippet into the .config files.</p> <blockquote><pre class=code><font size=3><span style="color:blue">&lt;?</span><span style="color:#a31515">xml </span><span style="color:red">version</span><span style="color:blue">=</span>&quot;<span style="color:blue">1.0</span>&quot;</font><font size=3><span style="color:blue">?&gt;
&lt;</span><span style="color:#a31515">configuration</span></font><font size=3><span style="color:blue">&gt;
  &lt;</span><span style="color:#a31515">startup </span><span style="color:red">useLegacyV2RuntimeActivationPolicy</span><span style="color:blue">=</span>&quot;<span style="color:blue">true</span>&quot;</font><font size=3><span style="color:blue">&gt;
    &lt;</span><span style="color:#a31515">supportedRuntime </span><span style="color:red">version</span><span style="color:blue">=</span>&quot;<span style="color:blue">v4.0.30319</span>&quot;</font><font size=3><span style="color:blue">/&gt;
    &lt;</span><span style="color:#a31515">supportedRuntime </span><span style="color:red">version</span><span style="color:blue">=</span>&quot;<span style="color:blue">v2.0.50727</span>&quot;</font><font size=3><span style="color:blue">/&gt;
  &lt;/</span><span style="color:#a31515">startup</span></font><font size=3><span style="color:blue">&gt;
&lt;/</span><span style="color:#a31515">configuration</span><span style="color:blue">&gt;</span></font> </pre></blockquote>
<p align=justify>Now when you restart PowerShell, attempting to load your module should yield no errors (if your module is compiled correctly and valid), and you should be able to implement the functionality from the module without any problem.</p>
<p align=justify><br>Enjoy<br>C<br><br></p>
<div class=wlWriterEditableSmartContent id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:746a15d6-9f4d-4c67-8dab-b61c672e4393" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px">Technorati Tags: <a href="http://technorati.com/tags/PowerShell" rel=tag>PowerShell</a>,<a href="http://technorati.com/tags/.NET+Framework+4.0" rel=tag>.NET Framework 4.0</a></div>
<p><a href="http://feeds.feedburner.com/cjvandyk"><img src="/blog/IMG/RSS.png" border=0></a><a href="http://linkedin.com/in/cjvandyk"><img src="/blog/IMG/LinkedIn.png" border=0></a><a href="http://www.facebook.com/cjvandyk"><img src="/blog/IMG/Facebook.png" border=0></a><a href="http://www.delicious.com/cjvandyk"><img src="/blog/IMG/Delicious.png" border=0></a></p></div></div>
<div><b>Category:</b> SharePoint;Tips;Windows Server;PowerShell</div>
<div><b>Published:</b> 9/3/2010 4:23 AM</div>
<div><b>Attachments:</b> <a href="http://www.cjvandyk.com/blog/Lists/Posts/Attachments/287/image_12_5D53F350.png">http://www.cjvandyk.com/blog/Lists/Posts/Attachments/287/image_12_5D53F350.png</a><br><a href="http://www.cjvandyk.com/blog/Lists/Posts/Attachments/287/image_3_5D53F350.png">http://www.cjvandyk.com/blog/Lists/Posts/Attachments/287/image_3_5D53F350.png</a><br><a href="http://www.cjvandyk.com/blog/Lists/Posts/Attachments/287/image_9_5D53F350.png">http://www.cjvandyk.com/blog/Lists/Posts/Attachments/287/image_9_5D53F350.png</a><br><a href=""></a></div>
]]></description>
      <author>Cornelius J. van Dyk</author>
      <category>SharePoint;Tips;Windows Server;PowerShell</category>
      <pubDate>Fri, 03 Sep 2010 11:23:24 GMT</pubDate>
      <guid isPermaLink="true">http://www.cjvandyk.com/blog/Lists/Posts/ViewPost.aspx?ID=287</guid>
    </item>
    <item>
      <title>Installing the .NET Framework 4.0 on your Windows Server 2008 R2 x64 server with SharePoint 2010</title>
      <link>http://www.cjvandyk.com/blog/Lists/Posts/ViewPost.aspx?ID=286</link>
      <description><![CDATA[<div><b>Body:</b> <div class=ExternalClassEB8C081573E9468AB7609F6DDF7372D5><p align=justify>As we all know, SharePoint 2010 is still using the .NET Framework 3.5.  That means that your servers may not have the latest .NET Framework 4.0 installed.  This could cause some issues if you're trying to use APIs from 4.0, or if you are trying to build some new tools using 4.0, like PowerShell management extensions for example.  The solution is to install 4.0 on your server.  Here's the quick Step-by-Step for doing this on a Windows Server 2008 R2 x64 system with SharePoint 2010 installed.</p> <ol> <li>Begin by downloading the full version of the Framework from here:  <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7&amp;displaylang=en</a>  <li>Once downloaded, double click the installer file named &quot;dotnetFx40_Full_x86_x64.exe&quot;.  <p></p><img title=image style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px" height=43 alt=image src="/blog/Lists/Posts/Attachments/286/image_15_1B631F9C.png" width=224 border=0> <p></p> <li>Windows may require you to confirm that you wish to launch the EXE.  If it does, simply click &quot;Run&quot;.  <p></p><img title=image style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px" height=305 alt=image src="/blog/Lists/Posts/Attachments/286/image_14_1B631F9C.png" width=409 border=0> <p></p> <li>You'd have to accept the EULA.  Check the &quot;I have read and accept the license terms&quot; check box.  <li>Click the &quot;Install&quot; button to commence the installation.  <p></p><img title=image style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px" height=470 alt=image src="/blog/Lists/Posts/Attachments/286/image_13_1B631F9C.png" width=507 border=0> <p></p> <li>The installer will crunch away for a while as it installs the Framework.  <p></p><img title=image style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px" height=470 alt=image src="/blog/Lists/Posts/Attachments/286/image_12_1B631F9C.png" width=508 border=0> <p></p> <li>Once installation complete, click the &quot;Finish&quot; button.  <p></p><img title=image style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px" height=470 alt=image src="/blog/Lists/Posts/Attachments/286/image_11_1B631F9C.png" width=508 border=0> <p></p> <li>No server restart is needed. :-)</li></ol> <p>Later<br>C<br></p> <div class=wlWriterEditableSmartContent id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:caef3cc3-f742-41b9-9879-3238c02716df" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px">Technorati Tags: <a href="http://technorati.com/tags/Step-by-Step" rel=tag>Step-by-Step</a>,<a href="http://technorati.com/tags/.NET+Framework+4.0" rel=tag>.NET Framework 4.0</a></div> <p></p> <p></p> <p></p> <p></p> <p></p> <p><a href="http://feeds.feedburner.com/cjvandyk"><img src="/blog/IMG/RSS.png" border=0></a><a href="http://linkedin.com/in/cjvandyk"><img src="/blog/IMG/LinkedIn.png" border=0></a><a href="http://www.facebook.com/cjvandyk"><img src="/blog/IMG/Facebook.png" border=0></a><a href="http://www.delicious.com/cjvandyk"><img src="/blog/IMG/Delicious.png" border=0></a></p></div></div>
<div><b>Category:</b> SharePoint;2010;Windows Server;2008;R2;Step-by-Step Guides</div>
<div><b>Published:</b> 9/3/2010 4:20 AM</div>
<div><b>Attachments:</b> <a href="http://www.cjvandyk.com/blog/Lists/Posts/Attachments/286/image_11_1B631F9C.png">http://www.cjvandyk.com/blog/Lists/Posts/Attachments/286/image_11_1B631F9C.png</a><br><a href="http://www.cjvandyk.com/blog/Lists/Posts/Attachments/286/image_12_1B631F9C.png">http://www.cjvandyk.com/blog/Lists/Posts/Attachments/286/image_12_1B631F9C.png</a><br><a href="http://www.cjvandyk.com/blog/Lists/Posts/Attachments/286/image_13_1B631F9C.png">http://www.cjvandyk.com/blog/Lists/Posts/Attachments/286/image_13_1B631F9C.png</a><br><a href="http://www.cjvandyk.com/blog/Lists/Posts/Attachments/286/image_14_1B631F9C.png">http://www.cjvandyk.com/blog/Lists/Posts/Attachments/286/image_14_1B631F9C.png</a><br><a href="http://www.cjvandyk.com/blog/Lists/Posts/Attachments/286/image_15_1B631F9C.png">http://www.cjvandyk.com/blog/Lists/Posts/Attachments/286/image_15_1B631F9C.png</a><br><a href=""></a></div>
]]></description>
      <author>Cornelius J. van Dyk</author>
      <category>SharePoint;2010;Windows Server;2008;R2;Step-by-Step Guides</category>
      <pubDate>Fri, 03 Sep 2010 11:20:22 GMT</pubDate>
      <guid isPermaLink="true">http://www.cjvandyk.com/blog/Lists/Posts/ViewPost.aspx?ID=286</guid>
    </item>
    <item>
      <title>How do I - Delete my SharePoint Shared Service Provider (SSP) when it fails to delete with STSADM</title>
      <link>http://www.cjvandyk.com/blog/Lists/Posts/ViewPost.aspx?ID=285</link>
      <description><![CDATA[<div><b>Body:</b> <div class=ExternalClassC87B211D226440B38A048DE3D08AFA58><p>When you enter </p> <p><strong><font face="Courier New" color="#0000ff" size=2>STSADM -o deletessp</font></strong> </p> <p>from your SharePoint web server command line, you should get this:</p> <p><img title=image style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px" height=53 alt=image src="/blog/Lists/Posts/Attachments/285/image_3_44AEF49C.png" width=225 border=0> </p> <p>If you then proceed to try and delete your SSP with a command such as </p> <p><strong><font face="Courier New" color="#0000ff" size=2>STSADM -o deletessp –title SharedServices1</font></strong></p> <p>but it still fails to delete, then you could use the <strong><u>undocumented</u></strong> -force flag thus:</p> <p><strong><font face="Courier New" color="#0000ff" size=2>STSADM -o deletessp –title SharedServices1 -force</font></strong></p> <p>Which should yield this:</p> <p><img title=image style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px" height=68 alt=image src="/blog/Lists/Posts/Attachments/285/image_6_2FBD7229.png" width=613 border=0> </p> <p> </p> <p>Gotta love those little –force flags. </p> <p>Later<br>C</p> <div class=wlWriterEditableSmartContent id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:7bd565d9-f968-4505-a1fc-095498568501" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px">Technorati Tags: <a href="http://technorati.com/tags/SharePoint" rel=tag>SharePoint</a>,<a href="http://technorati.com/tags/STSADM" rel=tag>STSADM</a></div> <p><a href="http://feeds.feedburner.com/cjvandyk"><img src="/blog/IMG/RSS.png" border=0></a><a href="http://linkedin.com/in/cjvandyk"><img src="/blog/IMG/LinkedIn.png" border=0></a><a href="http://www.facebook.com/cjvandyk"><img src="/blog/IMG/Facebook.png" border=0></a><a href="http://www.delicious.com/cjvandyk"><img src="/blog/IMG/Delicious.png" border=0></a></p></div></div>
<div><b>Category:</b> SharePoint;2007;Tips;STSADM</div>
<div><b>Published:</b> 8/27/2010 7:33 AM</div>
<div><b>Attachments:</b> <a href="http://www.cjvandyk.com/blog/Lists/Posts/Attachments/285/image_3_44AEF49C.png">http://www.cjvandyk.com/blog/Lists/Posts/Attachments/285/image_3_44AEF49C.png</a><br><a href="http://www.cjvandyk.com/blog/Lists/Posts/Attachments/285/image_6_2FBD7229.png">http://www.cjvandyk.com/blog/Lists/Posts/Attachments/285/image_6_2FBD7229.png</a><br><a href=""></a></div>
]]></description>
      <author>Cornelius J. van Dyk</author>
      <category>SharePoint;2007;Tips;STSADM</category>
      <pubDate>Fri, 27 Aug 2010 14:33:35 GMT</pubDate>
      <guid isPermaLink="true">http://www.cjvandyk.com/blog/Lists/Posts/ViewPost.aspx?ID=285</guid>
    </item>
  </channel>
</rss>