<?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>David&#039;s technobabble &#187; WSS</title>
	<atom:link href="http://bable.cybermarshall.com/category/wss/feed/" rel="self" type="application/rss+xml" />
	<link>http://bable.cybermarshall.com</link>
	<description>David&#039;s thoughts about this and that</description>
	<lastBuildDate>Fri, 22 Jan 2010 18:29:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What I hope gets &#8220;fixed&#8221; in SharePoint 2010</title>
		<link>http://bable.cybermarshall.com/2009/06/13/what-i-hope-gets-fixed-in-sharepoint-2010/</link>
		<comments>http://bable.cybermarshall.com/2009/06/13/what-i-hope-gets-fixed-in-sharepoint-2010/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 19:19:22 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[fckeditor]]></category>
		<category><![CDATA[foswiki]]></category>
		<category><![CDATA[tinymce]]></category>
		<category><![CDATA[twiki]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://bable.cybermarshall.com/?p=638</guid>
		<description><![CDATA[There are some limitations in WSS 3.0/SharePoint 2007 that are hurting the adoption of SharePoint 2007 at my company. I&#8217;m sure that this is pretty common. Many users are familiar with WordPress and Foswiki/TWiki. My users are looking for easy to use editors, plug-ins, and themes that they can use on their team sites and [...]]]></description>
			<content:encoded><![CDATA[<p>There are some limitations in WSS 3.0/SharePoint 2007 that are hurting the adoption of SharePoint 2007 at my company. I&#8217;m sure that this is pretty common. Many users are familiar with WordPress and Foswiki/TWiki. My users are looking for easy to use editors, plug-ins, and themes that they can use on their team sites and &#8220;my sites&#8221;.  With the &#8220;Revolution&#8221; in Social media and Web 2.0  users are familiar with open source web tools that allow rich-text editing and replaceable editors. They complain bitterly about editing their content, blog or a wiki inside SharePoint. <span id="more-638"></span></p>
<ul>
<li>The WSS 3.0/SharePoint 2007 WYSIWYG editor can’t upload images, video, audio clips and can&#8217;t insert Flash files.<br/>The workaround requires so many mouse clicks and web page interactions, that users look at me like I have &#8220;3 heads&#8221; when I show it to them.</li>
<li>Working with tables is difficult, at best</li>
<li>Any customizations such as:
<ul>
<li>custom file browsers,</li>
<li>link management,</li>
<li>syntax aware code viewers,</li>
<li>and much more</li>
</ul>
<p>are difficult to implement</li>
</ul>
<p>From a Wiki perspective </p>
<ul>
<li>Explicit syntax [[]]</li>
<li>No free form image inserts</li>
<li>No server side include of other topics.<br/>Need an easy way to include content from another site. In Foswiki/Twki the %{link} tag can be used</li>
<li>No easy upload and insert of attachments</li>
<li>No Easy way to insert links.<br/>Foswiki/TWiki support WikiWord/Camel Case.
<li>No tagging</li>
<li>WYSIWYG support for tables is ugly. You must know the number of rows and columns in advance.<br/>Foswiki/TWiki support simple &#8220;|&#8221; character based table definitions and an editable table plugin</li>
<li>No printable vew</li>
<li>No export to PDF/Word</li>
<li>Limited Alerts support.<br/>Email alerts say something changed and include the full text. However, this can not be customized to tell you what changed. You must login and see the history for that.<br/>Foswiki/Twiki support a highly customizable WebNotify</li>
<li>No easy support for multiple top level webs.<br/>There is only one flat &#8220;Wiki Pages&#8221; page with list view, no hierarchical view or some sort of sitemap feature.Wikis are made up of Topics that are interlinked in the form of a graph. Hence a specific Tree or Hierarchy structure is not the right representation. However, there must be a way to find all top level topics, i.e. Topics that are not linked to by any other topics. These topics will include
<ul>
<li>the starting points</li>
<li>new topics that have been added but not yet organized.</li>
</ul>
<p>I could not find a way to do this with this with the SharePoint Wiki. Even a simple way to flag a page as &#8220;add this page&#8221; to &#8220;Quick Launch&#8221; would help.</li>
<li>Not easy to provide a standard footer<br/>No apparent concept of templates</li>
</ul>
<p>The &#8220;MS/SharePoint 2007&#8243; update approach does not seem to fit into this &#8220;revolution&#8221;, either. The current approach requires direct access to the servers to install and activate extensions. With &#8220;Cloud Computing&#8221; and web hosting on the rise; the direct server access approach is not a good match. SharePoint needs something like a <a href="http://wordpress.org/extend/plugins/plugin-central/" onclick="pageTracker._trackPageview('/outgoing/wordpress.org/extend/plugins/plugin-central/?referer=');">Plug-in central</a> for SharePoint. Ideally, this could work on a site level and not require Central Administration be updated first. Another issue for remote management is that &#8220;by default&#8221; SharePoint Central Administration and SharePoint Sites must run on different tcp/ip ports. I&#8217;m sure that if I work real hard I can find a way to run them on the same port using &#8220;host-headers&#8221;. However, if I do, then will this really be supported or would the next next patch or upgrade break my sites?</p>
<p>So my wish list for SharePoint 2010 starts with:</p>
<ul>
<li>A site focused web based upload, install, and management capability similar to that found in <a href="http://wordpress.org/" onclick="pageTracker._trackPageview('/outgoing/wordpress.org/?referer=');">WordPress</a> and <a href="http://wordpress.org/extend/plugins/plugin-central/" onclick="pageTracker._trackPageview('/outgoing/wordpress.org/extend/plugins/plugin-central/?referer=');">Plug-in central for WordPress</a></li>
<li>A Rich-Text Editor that is rich in function, easily expandable and replaceable.<br />
Consider integrating a freely available javascript-based Rich-Text Editor for all browsers including IE. My primary choices would be <a href="http://www.fckeditor.net/" onclick="pageTracker._trackPageview('/outgoing/www.fckeditor.net/?referer=');">FCKEditor</a> and <a href="http://tinymce.moxiecode.com/" onclick="pageTracker._trackPageview('/outgoing/tinymce.moxiecode.com/?referer=');">TinyMCE or TinyMCE Advanved</a>.</li>
<li>A competitive wiki and blog, without having to buying 3rd party add-ons.</li>
</ul>
<p>Perhaps Microsoft only wants SharePoint to be a document sharing facility. Maybe I should not be trying to bend WSS and SharePoint into the social media and web 2.0 &#8220;arena&#8221;. Maybe that &#8220;arena&#8221; should just belong to Apache, Linux and Open Source.</p>
]]></content:encoded>
			<wfw:commentRss>http://bable.cybermarshall.com/2009/06/13/what-i-hope-gets-fixed-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>OCR&#8217;ing all of the PDF files in a SharePoint Document Library using PowerShell and Solid PDF Tools</title>
		<link>http://bable.cybermarshall.com/2009/05/27/ocring-all-of-the-pdf-files-in-a-sharepoint-document-library-using-powershell-and-solid-pdf-tools/</link>
		<comments>http://bable.cybermarshall.com/2009/05/27/ocring-all-of-the-pdf-files-in-a-sharepoint-document-library-using-powershell-and-solid-pdf-tools/#comments</comments>
		<pubDate>Thu, 28 May 2009 03:39:33 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<category><![CDATA[OCR]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[PowerGUI]]></category>
		<category><![CDATA[searchable PDF]]></category>

		<guid isPermaLink="false">http://bable.cybermarshall.com/?p=572</guid>
		<description><![CDATA[A recent review of the PDF Documents in our Document Control Library, revealed that most were &#8220;image only&#8221; PDF&#8217;s. We&#8217;ve run our document control system on different versions of SharePoint technologies since SharePoint Portal Server 2001. We are currently running SharePoint 2007. I&#8217;m surprised that someone did not previously notice that most of our PDF [...]]]></description>
			<content:encoded><![CDATA[<p>A recent review of the PDF Documents in our Document Control Library, revealed that most were &#8220;image only&#8221; PDF&#8217;s. We&#8217;ve run our document control system on different versions of SharePoint technologies since SharePoint Portal Server 2001. We are currently running SharePoint 2007. I&#8217;m surprised that someone did not previously notice that most of our PDF files were not showing up in the searches.</p>
<p>The question is:<em>&#8220;How can we get all of these PDFs reprocessed to be searchable for a reasonable cost?&#8221;</em><span id="more-572"></span> I spent some time reviewing various PDF tools and was surprised that few were &#8220;truly&#8221; scriptable in batch. Some tools would not run on a server or could not interface with a &#8220;HTTP Network Place&#8221;. There were some development kits that were marketed and priced for you to build your own PDF tools and they have a pretty spendy price tag.  These were out of scope with this year&#8217;s budget. Some, like Acrobat, had a batching mechanism in their GUI. However, this would require us to:</p>
<ul>
<li>Manually checkout all of the PDF&#8217;s</li>
<li>Download them into a folder structure</li>
<li>Batch them in the UI</li>
<li>Upload all of the OCR&#8217;ed PDFs</li>
<li>Manually check-in all of the PDF&#8217;s</li>
</ul>
<p>I don&#8217;t think so! We are talking about tens of thousands of documents. This would be labor intensive and prone to human error.</p>
<p>I&#8217;d just about given up finding something that would fit into the current budget, when I received an email notice about Solid Converter PDF V5 being available. While reviewing the v5 features, I noticed Solid PDF Tools v5 was out and it was just $20 more the upgrade to Solid Converter PDF v5. Low and behold, Solid PDF Tools v5 claims that it has a scriptable interface. I got to looking further and discovered their script reference manual and <a href="http://developer.soliddocuments.com/" onclick="pageTracker._trackPageview('/outgoing/developer.soliddocuments.com/?referer=');">developer blog</a>. I downloaded the trial and verified it. The software worked, I sent them my $59 upgrade fee and viola, I had a &#8220;<em>scriptable enough&#8221;</em> tool that I could re-scan &#8220;image-only&#8221; pdf files to create &#8220;searchable&#8221; pdf files. <em>I say &#8220;scriptable enough&#8221; because it gets the job done, but Solid PDF Tools v5 needs to load the GUI, load the splash screen, and display the UI for each file processed. This seems to add 10-15 seconds to the processing time of each file</em></p>
<p>Now to convert the &#8220;image-only&#8221; PDF&#8217;s in SharePoint. Once again, I decided to try PowerShell rather than write a C# program to interface with SharePoint. At the same time, I decided to give the <a href="http://www.powergui.org/downloads.jspa" onclick="pageTracker._trackPageview('/outgoing/www.powergui.org/downloads.jspa?referer=');">PowerGUI Tools</a> a try. I found the PowerGUI Script Editor to be quite useful for developing, debugging and running my script.</p>
<p>The &#8220;proof-of-concept&#8221; result is ~100 lines of PowerShell code that</p>
<ul>
<li>processes all of the webs in a sharepoint site</li>
<li>processes all of the folders and sub-folders</li>
<li>processes all of the PDF documents and sends them to OCR processing</li>
</ul>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p572code2'); return false;">View Code</a> POWERSHELL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p5722"><td class="code" id="p572code2"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;">## References</span>
<span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">System.Reflection.Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #800000;">LoadWithPartialName</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Microsoft.SharePoint&quot;</span><span style="color: #000000;">&#41;</span> 
<span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">System.Reflection.Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #800000;">LoadWithPartialName</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;System.IO&quot;</span><span style="color: #000000;">&#41;</span> 
&nbsp;
<span style="color: #800080;">$SolidPDFTools</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;$env:SolidPDFTools.exe&quot;</span> 
<span style="color: #800080;">$LocalFileFolder</span><span style="color: pink;">=</span> <span style="color: #800000;">&quot;D:\spwork\input&quot;</span>;
<span style="color: #800080;">$OCRWorkFolder</span><span style="color: pink;">=</span> <span style="color: #800000;">&quot;D:\spwork\output&quot;</span>;
<span style="color: #800080;">$OCRWorkLogFolder</span><span style="color: pink;">=</span> <span style="color: #800000;">&quot;D:\spwork\logs&quot;</span>;
<span style="color: #800080;">$OCRScriptFile</span><span style="color: pink;">=</span> <span style="color: #800000;">&quot;D:\spwork\ocr.sdscript&quot;</span>;
&nbsp;
<span style="color: #0000FF;">function</span> script:write_local_file<span style="color: #000000;">&#40;</span><span style="color: #800080;">$file</span><span style="color: pink;">,</span> <span style="color: #800080;">$fileFolder</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #800080;">$fs</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.IO.FileStream<span style="color: #000000;">&#40;</span>$<span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Join-Path</span> <span style="color: #800080;">$fileFolder</span> <span style="color: #800080;">$file</span>.Name<span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> <span style="color: #000000;">&#91;</span>System.IO.FileMode<span style="color: #000000;">&#93;</span>::Create<span style="color: #000000;">&#41;</span>
	<span style="color: #800080;">$bw</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.IO.BinaryWriter<span style="color: #000000;">&#40;</span><span style="color: #800080;">$fs</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#91;</span><span style="color: #008080;">Byte</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$binfile</span> <span style="color: pink;">=</span> <span style="color: #800080;">$file</span>.OpenBinary<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;    
	<span style="color: #800080;">$bw</span>.<span style="color: #008080; font-weight: bold;">Write</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$binfile</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #800080;">$bw</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #800080;">$fs</span>.close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0000FF;">function</span> script:ocr_local_file<span style="color: #000000;">&#40;</span><span style="color: #800080;">$file</span><span style="color: pink;">,</span> <span style="color: #800080;">$in_fpath</span><span style="color: pink;">,</span> <span style="color: #800080;">$out_fpath</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #800080;">$infile</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Join-Path</span> <span style="color: #800080;">$in_fpath</span> <span style="color: #800080;">$file</span>.Name;
	<span style="color: #800080;">$infile</span> <span style="color: pink;">=</span> <span style="color: #800080;">$infile</span> <span style="color: #FF0000;">-replace</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;\\&quot;</span><span style="color: pink;">,</span><span style="color: #800000;">&quot;\\&quot;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #800080;">$outfile</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Join-Path</span> <span style="color: #800080;">$out_fpath</span> <span style="color: #800080;">$file</span>.Name;
	<span style="color: #800080;">$outfile</span> <span style="color: pink;">=</span> <span style="color: #800080;">$outfile</span> <span style="color: #FF0000;">-replace</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;\\&quot;</span><span style="color: pink;">,</span><span style="color: #800000;">&quot;\\&quot;</span><span style="color: #000000;">&#41;</span>;
        <span style="color: #800080;">$logfile</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Join-Path</span> <span style="color: #800080;">$OCRWorkLogFolder</span> <span style="color: #800000;">&quot;debug.log&quot;</span>;
	<span style="color: #800080;">$logfile</span> <span style="color: pink;">=</span> <span style="color: #800080;">$logfile</span> <span style="color: #FF0000;">-replace</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;\\&quot;</span><span style="color: pink;">,</span><span style="color: #800000;">&quot;\\&quot;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #800080;">$DBG</span><span style="color: pink;">=</span><span style="color: #800000;">'&lt;&lt;/Level/Verbose /Emit (starting) /FileName ('</span> <span style="color: pink;">+</span>  <span style="color: #800080;">$logfile</span> <span style="color: pink;">+</span><span style="color: #800000;">') &gt;&gt; Trace'</span>;
	<span style="color: #800080;">$INP</span><span style="color: pink;">=</span><span style="color: #800000;">'&lt;&lt;/Input ('</span> <span style="color: pink;">+</span> <span style="color: #800080;">$infile</span> <span style="color: pink;">+</span> <span style="color: #800000;">')'</span>;
	<span style="color: #800080;">$OTP</span><span style="color: pink;">=</span><span style="color: #800000;">'/Output ('</span> <span style="color: pink;">+</span> <span style="color: #800080;">$outfile</span> <span style="color: pink;">+</span> <span style="color: #800000;">')'</span>;
	<span style="color: #800080;">$OCR</span><span style="color: pink;">=</span><span style="color: #800000;">'/OCR/Searchable'</span>;
	<span style="color: #800080;">$CRE</span><span style="color: pink;">=</span><span style="color: #800000;">'&gt;&gt; Create'</span>;
	<span style="color: #800080;">$XIT</span><span style="color: pink;">=</span><span style="color: #800000;">'EXIT'</span>;
	<span style="color: #008080; font-weight: bold;">Write-output</span> <span style="color: #800080;">$DBG</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Out<span style="color: #FF0000;">-File</span></span> <span style="color: #800080;">$OCRScriptFile</span> <span style="color: #008080; font-style: italic;">-encoding</span> ascii;
	<span style="color: #008080; font-weight: bold;">Write-output</span> <span style="color: #800080;">$INP</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Out<span style="color: #FF0000;">-File</span></span> <span style="color: #800080;">$OCRScriptFile</span> <span style="color: #008080; font-style: italic;">-append</span> <span style="color: #008080; font-style: italic;">-encoding</span> ascii;
	<span style="color: #008080; font-weight: bold;">Write-output</span> <span style="color: #800080;">$OTP</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Out<span style="color: #FF0000;">-File</span></span> <span style="color: #800080;">$OCRScriptFile</span> <span style="color: #008080; font-style: italic;">-append</span> <span style="color: #008080; font-style: italic;">-encoding</span> ascii;
	<span style="color: #008080; font-weight: bold;">Write-output</span> <span style="color: #800080;">$OCR</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Out<span style="color: #FF0000;">-File</span></span> <span style="color: #800080;">$OCRScriptFile</span> <span style="color: #008080; font-style: italic;">-append</span> <span style="color: #008080; font-style: italic;">-encoding</span> ascii;
	<span style="color: #008080; font-weight: bold;">Write-output</span> <span style="color: #800080;">$CRE</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Out<span style="color: #FF0000;">-File</span></span> <span style="color: #800080;">$OCRScriptFile</span> <span style="color: #008080; font-style: italic;">-append</span> <span style="color: #008080; font-style: italic;">-encoding</span> ascii;
	<span style="color: #008080; font-weight: bold;">Write-output</span> <span style="color: #800080;">$XIT</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Out<span style="color: #FF0000;">-File</span></span> <span style="color: #800080;">$OCRScriptFile</span> <span style="color: #008080; font-style: italic;">-append</span> <span style="color: #008080; font-style: italic;">-encoding</span> ascii;  
&nbsp;
	<span style="color: #800080;">$sTemp</span> <span style="color: pink;">=</span> <span style="color: pink;">&amp;</span>SolidPDFTools <span style="color: pink;">/</span>i <span style="color: #800080;">$OCRScriptFile</span> <span style="color: pink;">/</span>f script 
	<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800080;">$sTemp</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0000FF;">function</span> script:upload_ocr_result<span style="color: #000000;">&#40;</span><span style="color: #800080;">$file</span><span style="color: pink;">,</span> <span style="color: #800080;">$ocr_fpath</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #800080;">$ocrfile</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Join-Path</span> <span style="color: #800080;">$ocr_fpath</span> <span style="color: #800080;">$file</span>.Name;
	<span style="color: #800080;">$fs</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.IO.FileStream<span style="color: #000000;">&#40;</span>$<span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Join-Path</span> <span style="color: #800080;">$ocr_fpath</span> <span style="color: #800080;">$file</span>.Name<span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> <span style="color: #000000;">&#91;</span>System.IO.FileMode<span style="color: #000000;">&#93;</span>::Open<span style="color: #000000;">&#41;</span>
	<span style="color: #800080;">$br</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.IO.BinaryReader<span style="color: #000000;">&#40;</span><span style="color: #800080;">$fs</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#91;</span><span style="color: #008080;">Byte</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$binfile</span> <span style="color: pink;">=</span> <span style="color: #800080;">$br</span>.ReadBytes<span style="color: #000000;">&#40;</span><span style="color: #800080;">$br</span>.BaseStream.Length<span style="color: #000000;">&#41;</span>;
	<span style="color: #800080;">$file</span>.SaveBinary<span style="color: #000000;">&#40;</span><span style="color: #800080;">$binfile</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #800080;">$br</span>.close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #800080;">$fs</span>.close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
 <span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0000FF;">function</span> script:process_a_folder<span style="color: #000000;">&#40;</span><span style="color: #800080;">$folder</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #800080;">$files</span> <span style="color: pink;">=</span> <span style="color: #800080;">$folder</span>.Files;
	<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$file</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$files</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;">$file</span>.Name.ToLower<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.Contains<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;.pdf&quot;</span><span style="color: #000000;">&#41;</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;">$file</span>.CheckOutStatus <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">&quot;None&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #800080;">$file</span>.CheckOut<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
            			write_local_file <span style="color: #800080;">$file</span> <span style="color: #800080;">$LocalFileFolder</span>;
				ocr_local_file <span style="color: #800080;">$file</span> <span style="color: #800080;">$LocalFileFolder</span> <span style="color: #800080;">$OCRWorkFolder</span>;
				upload_ocr_result <span style="color: #800080;">$file</span> <span style="color: #800080;">$OCRWorkFolder</span>; 
				<span style="color: #800080;">$file</span>.CheckIn<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;version has had OCR processing performed&quot;</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #800080;">$file</span>.Update<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #800080;">$sub_folders</span> <span style="color: pink;">=</span> <span style="color: #800080;">$folder</span>.SubFolders;
	process_folders<span style="color: #000000;">&#40;</span><span style="color: #800080;">$sub_folders</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0000FF;">function</span> script:process_folders<span style="color: #000000;">&#40;</span><span style="color: #800080;">$folders</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$folder</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$folders</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		process_a_folder<span style="color: #000000;">&#40;</span><span style="color: #800080;">$folder</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0000FF;">function</span> script:append<span style="color: pink;">-</span>path <span style="color: #000000;">&#123;</span>
	<span style="color: #800080;">$oldPath</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">get-content</span> Env:\Path;
	<span style="color: #800080;">$newPath</span> <span style="color: pink;">=</span> <span style="color: #800080;">$oldPath</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;;&quot;</span> <span style="color: pink;">+</span> <a href="about:blank"><span style="color: #000080;">$args</span></a>;
	<span style="color: #008080; font-weight: bold;">set-content</span> Env:\Path <span style="color: #800080;">$newPath</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008000;"># MAIN</span>
append<span style="color: pink;">-</span>path <span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">resolve-path</span> <span style="color: #800000;">'D:\Program Files\SolidDocuments\Solid PDF Tools\SPDFT'</span><span style="color: #000000;">&#41;</span>.Path
&nbsp;
<span style="color: #800080;">$site</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">new-object</span> Microsoft.SharePoint.SPSite<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;http://my-sp-server&quot;</span><span style="color: #000000;">&#41;</span>;   
<span style="color: #800080;">$siteweb</span> <span style="color: pink;">=</span> <span style="color: #800080;">$site</span>.OpenWeb<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;   
<span style="color: #800080;">$webs</span> <span style="color: pink;">=</span> <span style="color: #800080;">$siteweb</span>.Webs;   
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$web</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$webs</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>   
	<span style="color: #800080;">$folders</span> <span style="color: pink;">=</span> <span style="color: #800080;">$web</span>.Folders;
	process_folders<span style="color: #000000;">&#40;</span><span style="color: #800080;">$folders</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>I do plan to add some logging, change the hard-coded variables, and look at using streams instead of Byte[] to be more flexible and scaleable. I&#8217;ll need some error handling to deal with things like download or upload failures before I can run this in production. I&#8217;m also trying to determine if a PDF is &#8220;image only&#8221; or searchable. However, the &#8220;Proof-of-concept&#8221; does work.</p>
]]></content:encoded>
			<wfw:commentRss>http://bable.cybermarshall.com/2009/05/27/ocring-all-of-the-pdf-files-in-a-sharepoint-document-library-using-powershell-and-solid-pdf-tools/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Using PowerShell to activate a feature across all Sharepoint 2007/WSS 3.0 sites and subsites</title>
		<link>http://bable.cybermarshall.com/2009/01/17/using-powershell-to-activate-a-feature-across-all-sharepoint-2007wss-30-sites-and-subsites/</link>
		<comments>http://bable.cybermarshall.com/2009/01/17/using-powershell-to-activate-a-feature-across-all-sharepoint-2007wss-30-sites-and-subsites/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 18:57:35 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[WSS 3.0]]></category>

		<guid isPermaLink="false">http://bable.cybermarshall.com/?p=338</guid>
		<description><![CDATA[Recently, I was deploying a new feature to a WSS 3.0 site and needed to activate the feature on roughly 100 subsites. I did not want to do this manually with the web interface. I knew that I could write a C# program to do this, but I&#8217;d read a lot about the capabilities of [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I was deploying a new feature to a WSS 3.0 site and needed to activate the feature on roughly 100 subsites. I did not want to do this manually with the web interface. I knew that I could write a C# program to do this, but I&#8217;d read a lot about the capabilities of PowerShell and decided to see how this could be done with PowerShell.<br />
<span id="more-338"></span><br />
After downloading and installing PowerShell 1.0 on my Windows 2003 test server, I spent some time getting familiar with PowerShell and reading what others had done. I found a very helpful site to be <a href="http://sharepoint.microsoft.com/blogs/zach" onclick="pageTracker._trackPageview('/outgoing/sharepoint.microsoft.com/blogs/zach?referer=');">Zach Rosenfield&#8217;s blog</a> and the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.aspx" onclick="pageTracker._trackPageview('/outgoing/msdn.microsoft.com/en-us/library/microsoft.sharepoint.aspx?referer=');">Microsoft.SharePoint class reference on msdn</a>. Based on my experience building custom workflows for sharepoint, I knew that if could obtain the list of website urls for a sharepoint site, then I could then call the STSADM program to activate the feature by name for the site by URL</p>
<ul> stsadm -o activatefeature -name <em>feature-name</em> -url <em>websiteurl</em> -force</ul>
<p>The synopsis of the <a href="#fullcode">code</a> is:</p>
<ul>
<li>Start with the sharepoint site object.</li>
<li>Loop through all of the sub-sites.
<ul>
<li>Get the website url for the sub-site.</li>
<li>Call stsadm to activate the feature for the sub-site.</li>
</ul>
</li>
</ul>
<p><a id="fullcode" name="fullcode"></a><br />
<strong>The PowerShell code</strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p338code4'); return false;">View Code</a> POWERSHELL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3384"><td class="code" id="p338code4"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;">## Reference to SharePoint DLL</span>
<span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">System.Reflection.Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #800000;">LoadWithPartialName</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Microsoft.SharePoint&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #008000;">## Probable location of sharepoint STSADM utility program</span>
<span style="color: #800080;">$stsadm</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;$env:programfiles\Common Files\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE&quot;</span> 
&nbsp;
<span style="color: #008000;">############################################</span>
<span style="color: #008000;"># Activate-feature-onSite [-feature  |-url  ]</span>
<span style="color: #008000;">############################################</span>
<span style="color: #0000FF;">function</span> global:Activate<span style="color: pink;">-</span>feature<span style="color: pink;">-</span>onSite<span style="color: #000000;">&#40;</span><span style="color: #800080;">$feature</span><span style="color: pink;">,</span> <span style="color: #800080;">$url</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #800080;">$spsite</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">new-object</span> Microsoft.SharePoint.SPSite<span style="color: #000000;">&#40;</span><span style="color: #800080;">$url</span><span style="color: #000000;">&#41;</span>; 
&nbsp;
<span style="color: #0000FF;">for</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$i</span><span style="color: pink;">=</span><span style="color: #804000;">0</span>; <span style="color: #800080;">$i</span> <span style="color: #FF0000;">-lt</span> <span style="color: #800080;">$spsite</span>.AllWebs.Count;$i<span style="color: pink;">++</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
   <span style="color: #800080;">$websiteurl</span><span style="color: pink;">=</span>  <span style="color: #800080;">$spsite</span>.AllWebs<span style="color: #000000;">&#91;</span><span style="color: #800080;">$i</span><span style="color: #000000;">&#93;</span>.url;
   <span style="color: #800080;">$sResult</span> <span style="color: pink;">=</span> <span style="color: pink;">&amp;</span>stsadm <span style="color: pink;">-</span>o activatefeature <span style="color: #008080; font-style: italic;">-name</span> <span style="color: #800080;">$feature</span> <span style="color: pink;">-</span>url <span style="color: #800080;">$websiteurl</span> <span style="color: #008080; font-style: italic;">-force</span>
   <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: pink;">!</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$sResult</span> <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*Operation completed successfully*&quot;</span><span style="color: #000000;">&#41;</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: #008080; font-style: italic;">-ForegroundColor</span> <span style="color: #800000;">&quot;red&quot;</span> <span style="color: #008080; font-style: italic;">-BackgroundColor</span> <span style="color: #800000;">&quot;white&quot;</span> <span style="color: #800000;">&quot;Activate of feature '$feature' for '$websiteurl' Failed! <span style="color: #008080; font-weight: bold;">`n</span> $sResult&quot;</span>
     <span style="color: #000000;">&#125;</span>
   <span style="color: #000000;">&#125;</span>
<span style="color: #800080;">$spsite</span>.Dispose<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span> 
&nbsp;
<span style="color: #008000;"># to call</span>
Activate<span style="color: pink;">-</span>feature<span style="color: pink;">-</span>onSite <span style="color: #800000;">&quot;feature&quot;</span> <span style="color: #800000;">&quot;http://site&quot;</span></pre></td></tr></table></div>

<p><center><script type="text/javascript"><!--
google_ad_client = "pub-5633552336244805";
google_ad_slot = "5649858591";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://bable.cybermarshall.com/2009/01/17/using-powershell-to-activate-a-feature-across-all-sharepoint-2007wss-30-sites-and-subsites/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating and registering a sitemap to Google for a WSS 3.0/SharePoint 2007 site.</title>
		<link>http://bable.cybermarshall.com/2009/01/10/creating-and-registering-a-sitemap-to-google-for-a-wss-30sharepoint-2007-site/</link>
		<comments>http://bable.cybermarshall.com/2009/01/10/creating-and-registering-a-sitemap-to-google-for-a-wss-30sharepoint-2007-site/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 17:05:04 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[WSS 3.0]]></category>

		<guid isPermaLink="false">http://bable.cybermarshall.com/?p=320</guid>
		<description><![CDATA[If you develop or maintain internet facing websites, then you already know what a sitemap is and does. I create and maintain site maps for several sites. I recently added a sitemap to my WSS 3.0 site. With other web technologies this can be a 10 minute process. With SharePoint this turned out to have [...]]]></description>
			<content:encoded><![CDATA[<p>If you develop or maintain internet facing websites, then you already know what a sitemap is and does. I create and maintain site maps for several sites. I recently added a sitemap to my WSS 3.0 site. With other web technologies this can be a 10 minute process. With SharePoint this turned out to have a few wrinkles.<br />
<span id="more-320"></span><br />
The 1<sup>st</sup> thing that I did was generate a sitemap of my SharePoint site using a free <a href="http://www.xml-sitemaps.com" onclick="pageTracker._trackPageview('/outgoing/www.xml-sitemaps.com?referer=');">Sitemap Generator</a>. Then I logged into my Google account to access my webmaster tools. The 1st challenge was to <a href="#verify">verify</a> my site, the next challenge would be to get Google to download the <a href="#sitemap">sitemap</a> from my site.<br />
<a id="verify" name="verify"></a><br />
<strong>Verifying my site</strong><br />
This is Google&#8217;s way of making sure that you are authorized to manage the site. Currently, Google lets you do this 2 ways:</p>
<ul>
<li>This first way, involves placing an HTML file on your site using an Google generated HTML file name.<br />
This must be placed in the root directory of you site.</li>
<li>The 2<sup>nd</sup> way involves placing a Google generated meta tag in your site&#8217;s default webpage.</li>
</ul>
<p>Based upon my previous experience with SharePoint, I tried the HTML file first. Using Internet Services Manager I determined the physical directory that was mapped to the virtual directory for my SharePoint site. Next, I created an HTML file in that directory using the name that Google provided and &#8220;viola&#8221;, I figured that I was done.  Unfortunately, the way SharePoint sites are registered into IIS, a SharePoint site would not render my HTML file from this location. This results in a 404 error. On to the meta tag option.</p>
<p>My 1<sup>st</sup> attempt at the meta tag option was to create a hidden &#8220;Content Editor Webpart&#8221; on my site&#8217;s home page and place the meta code in it. I suspected that this would not work as the meta tag needs to go into the head section of the HTML page before the body section. Sure enough, it did not work.</p>
<p>My next approach was to determine which file that I could modify to place my meta tag in.<br />
<em>I&#8217;m sure that there is a SharePoint Designer way to do this. However, if you are using the free version of SharePoint 2007, then I figure you may not want to buy SharePoint Designer.</em></p>
<p>SharePoint sites open with a default.aspx file that is based on the site type. There is are seperate default.aspx for Team Sites, Blog Sites, etc. Each of these default.aspx files include a default.master.  The default master can be overridden on a site by site basis by editing the default.master in your site&#8217;s &#8220;Master Page Gallery&#8221; by accessing &#8220;Site Actions&#8221; &#8211;&gt; &#8220;Site Settings&#8221; and then selecting the &#8220;Master Pages&#8221; Link in the &#8220;Galleries&#8221; section. Rather than change the default.aspx which would affect all sites of a type running on my server, I decided to change the default master for my site.</p>
<p>To change the default.master, you will:</p>
<ul>
<li> check it out.</li>
<li> download a copy</li>
<li> edit it with notepad (or some other text editor) and place your meta tag<br />
I chose to place my Google meta tag just below the<br />
&lt;META HTTP-EQUIV=&#8221;Expires&#8221; content=&#8221;0&#8243;&gt;</li>
<li>upload the update</li>
<li>check-in the file</li>
</ul>
<p>You can verify that this is correct by visiting your site&#8217;s homepage and then viewing the page source via your Web Browser. If you can see your verify code, you are ready to verify your site with Google and move to publishing your sitemap.<br />
<a id="sitemap" name="sitemap"></a><br />
<strong>Getting my sitemap into google</strong><br />
In order to get Google to download my sitemap, the sitemap file, sitemap.xml in my case, would need to be anonymously accessible form a url on your site that Google lets you specify. I already knew that I could not simply place the sitemap file into the root directory of my website. My solution was to create a SharePoint document library in my site, provide anonymous read access and upload the sitemap.xml file to that library.<br />
Then I entered the sitemap url into Google.</p>
<p><center><script type="text/javascript"><!--
google_ad_client = "pub-5633552336244805";
google_ad_slot = "5649858591";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://bable.cybermarshall.com/2009/01/10/creating-and-registering-a-sitemap-to-google-for-a-wss-30sharepoint-2007-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing and enhancing the security of a WSS 3.0/SharePoint 2007 site</title>
		<link>http://bable.cybermarshall.com/2009/01/08/customizing-and-enhancing-the-security-of-a-wss-30sharepoint-2007-site/</link>
		<comments>http://bable.cybermarshall.com/2009/01/08/customizing-and-enhancing-the-security-of-a-wss-30sharepoint-2007-site/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 04:00:14 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[conditional]]></category>
		<category><![CDATA[rendering]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[WSS 3.0]]></category>

		<guid isPermaLink="false">http://bable.cybermarshall.com/?p=272</guid>
		<description><![CDATA[I wanted to compare the capabilities of WSS 3.0 (Sharepoint 2007) to host forum-like discussions, blogs and wiki&#8217;s. After I&#8217;d developed my site, there were items that were visible to anonymous and standard users that I felt were inappropriate. I wanted information to be visible or not based upon the users role. Such as the [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to compare the capabilities of WSS 3.0 (Sharepoint 2007) to host forum-like discussions, blogs and wiki&#8217;s. After I&#8217;d developed my site, there were items that were visible to anonymous and standard users that I felt were inappropriate. I wanted information to be visible or not based upon the users role. Such as the ability to view lists of People and Groups.  I&#8217;ve worked in several businesses where exposing customer names to all users is a violation of customer agreements. IMHO, this is a serious oversight in Microsoft&#8217;s implementation.<br />
<span id="more-272"></span><br />
After I did a good bit of research, experimentation and learning I was able to change the security using the SPSecurityTrimmedControl. Here is how I restricted access to some portions on my Sharepoint Site.</p>
<p>WSS 3.0 provides a control <a href="#spstrim">SPSecurityTrimmedControl</a> that allows the conditional rendering of content based on a users permission. Using this control, I was able to restrict who would be shown People and Groups on my site.  To do this I modified the <a href="#people">people.aspx</a> and the <a href="#groups">groups.aspx</a> files for my site.</p>
<p><em>A word of caution: I have no doubt that when applying a future service pack, Microsoft will overwrite my changes. Therefore I&#8217;m managing my changes externally from the Microsoft SharePoint directory. This will allow me to difference new code from Microsoft and reapply my changes.</em></p>
<p><a id="people" name="people"></a><br />
<strong>people.aspx</strong><br />
The file people.aspx resides in the <span style="text-decoration: underline;"><em>\Program Files\Common Files\Microsoft Shared\web server  extensions\12\TEMPLATE\LAYOUTS</em></span> folder. It lists the persons in the site. After I made a backup copy, I opened the file in a text editor and located the start of the &#8220;PlaceHolderMain&#8221; asp:Content section and added the start of my permission change</p>
<p>before</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p272code10'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p27210"><td class="code" id="p272code10"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:Content</span> <span style="color: #000066;">contentplaceholderid</span>=<span style="color: #ff0000;">&quot;PlaceHolderMain&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:PlaceHolder</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;PanelAllPeople&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;ms-listdescription&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></td></tr></table></div>

<p>after</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p272code11'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p27211"><td class="code" id="p272code11"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:Content</span> <span style="color: #000066;">contentplaceholderid</span>=<span style="color: #ff0000;">&quot;PlaceHolderMain&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SharePoint:SPSecurityTrimmedControl</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span> <span style="color: #000066;">PermissionsString</span>=<span style="color: #ff0000;">&quot;ManagePermissions&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:PlaceHolder</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;PanelAllPeople&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;ms-listdescription&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></td></tr></table></div>

<p>I located the end of the &#8220;PlaceHolderMain&#8221; asp:Content section and completed my permission change.</p>
<p>before</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p272code12'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p27212"><td class="code" id="p272code12"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:HyperLink</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;LnkCallTo&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">Text</span>=<span style="color: #ff0000;">&quot;&lt;%$SPHtmlEncodedResources:wss,people_callbuttontext%&gt;</span></span>&quot;
		style=&quot;visibility:hidden;display:none&quot;
		NavigateUrl=&quot;callto:&quot; /&gt;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/asp:Content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>after</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p272code13'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p27213"><td class="code" id="p272code13"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:HyperLink</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;LnkCallTo&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">Text</span>=<span style="color: #ff0000;">&quot;&lt;%$SPHtmlEncodedResources:wss,people_callbuttontext%&gt;</span></span>&quot;
		style=&quot;visibility:hidden;display:none&quot;
		NavigateUrl=&quot;callto:&quot; /&gt;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SharePoint:SPSecurityTrimmedControl<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/asp:Content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>I also located the modifed the &#8220;PlaceHolderLeftNavBar&#8221; asp:Content and made the similar changes as above to require the user to have ManagePermissions as well.</p>
<p><a id="groups" name="groups"></a><br />
<strong>groups.aspx</strong><br />
The file group.aspx resides in the<span style="text-decoration: underline;"><em> \Program Files\Common Files\Microsoft Shared\web server  extensions\12\TEMPLATE\LAYOUTS</em></span> folder. It lists the groups in the site.  After I made a backup copy, I opened the file in a text editor and made the same &#8220;PlaceHolderMain&#8221; asp:Content section changes as I had to <a href="#people">people.aspx</a>.</p>
<p><a id="spstrim" name="spstrim"></a><br />
<strong>Overview of SPSecurityTrimmedControl</strong></p>
<p>The SPSecurityTrimmedControl conditionally renders the included contents only when the current user has the permissions defined by the PemissionsString.<br />
An example requiring the user to have &#8220;ManagePermissions&#8221;:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p272code14'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p27214"><td class="code" id="p272code14"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Sharepoint:SPSecurityTrimmedControl</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span> <span style="color: #000066;">PermissionsString</span>=<span style="color: #ff0000;">&quot;ManagePermissions&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">...</span>
<span style="color: #808080; font-style: italic;">... code being managed ...</span>
<span style="color: #808080; font-style: italic;">...</span>
<span style="color: #808080; font-style: italic;">--&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SharePoint:SPSecurityTrimmedControl<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Here are some of the values for the PermissionsString</p>
<table border="0">
<tbody>
<tr>
<td><em><strong>Permissions String</strong></em></td>
<td><em><strong>Description</strong></em></td>
</tr>
<tr>
<td>AddAndCustomizePages</td>
<td>Add, change, or delete HTML pages or Web Part Pages, and edit the Web site using a Windows SharePoint Services–compatible editor.</td>
</tr>
<tr>
<td>AddDelPrivateWebParts</td>
<td>Add or remove personal Web Parts on a Web Part Page.</td>
</tr>
<tr>
<td>AddListItems</td>
<td>Add items to lists, add documents to document libraries, and add Web discussion comments.</td>
</tr>
<tr>
<td>ApproveItems</td>
<td>Approve a minor version of a list item or document.</td>
</tr>
<tr>
<td>BrowseDirectories</td>
<td>Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces.</td>
</tr>
<tr>
<td>BrowseUserInfo</td>
<td>View information about users of the Web site.</td>
</tr>
<tr>
<td>CancelCheckout</td>
<td>Discard or check in a document which is checked out to another user.</td>
</tr>
<tr>
<td>CreateAlerts</td>
<td>Create e-mail alerts.</td>
</tr>
<tr>
<td>CreateGroups</td>
<td>Create a group of users that can be used anywhere within the site collection.</td>
</tr>
<tr>
<td>DeleteListItems</td>
<td>Delete items from a list, documents from a document library, and Web discussion comments in documents.</td>
</tr>
<tr>
<td>DeleteVersions</td>
<td>Delete past versions of a list item or document.</td>
</tr>
<tr>
<td>EditListItems</td>
<td>Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries.</td>
</tr>
<tr>
<td>EditMyUserInfo</td>
<td>Allows a user to change his or her user information, such as adding a picture.</td>
</tr>
<tr>
<td>EnumeratePermissions</td>
<td>Enumerate permissions on the Web site, list, folder, document, or list item.</td>
</tr>
<tr>
<td>ManageAlerts</td>
<td>Manage alerts for all users of the Web site.</td>
</tr>
<tr>
<td>ManageLists</td>
<td>Create and delete lists, add or remove columns in a list, and add or remove public views of a list.</td>
</tr>
<tr>
<td>ManagePermissions</td>
<td>Create and change permission levels on the Web site and assign permissions to users and groups.</td>
</tr>
<tr>
<td>ManagePersonalViews</td>
<td>Create, change, and delete personal views of lists.</td>
</tr>
<tr>
<td>Open</td>
<td>Allow users to open a Web site, list, or folder to access items inside that container.</td>
</tr>
<tr>
<td>OpenItems</td>
<td>View the source of documents with server-side file handlers.</td>
</tr>
<tr>
<td>UpdatePersonalWebParts</td>
<td>Update Web Parts to display personalized information.</td>
</tr>
<tr>
<td>ViewFormPages</td>
<td>View forms, views, and application pages, and enumerate lists.</td>
</tr>
<tr>
<td>ViewListItems</td>
<td>View items in lists, documents in document libraries, and view Web discussion comments.</td>
</tr>
<tr>
<td>ViewPages</td>
<td>View pages in a Web site.</td>
</tr>
<tr>
<td>ViewUsageData</td>
<td>View reports on Web site usage.</td>
</tr>
<tr>
<td>ViewVersions</td>
<td>View past versions of a list item or document.</td>
</tr>
</tbody>
</table>
<p>The full list is on <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx" onclick="pageTracker._trackPageview('/outgoing/msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx?referer=');">msdn</a>.</p>
<p><center><script type="text/javascript"><!--
google_ad_client = "pub-5633552336244805";
google_ad_slot = "5649858591";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://bable.cybermarshall.com/2009/01/08/customizing-and-enhancing-the-security-of-a-wss-30sharepoint-2007-site/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
