<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Imagine Think Create Share : HowTo</title><link>http://blogs.msdn.com/carloshm/archive/tags/HowTo/default.aspx</link><description>Tags: HowTo</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How to: Programmatically Manage the Crawl of a Content Source in PowerShell </title><link>http://blogs.msdn.com/carloshm/archive/2009/03/31/how-to-programmatically-manage-the-crawl-of-a-content-source-in-powershell.aspx</link><pubDate>Tue, 31 Mar 2009 19:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9523361</guid><dc:creator>carloshm</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/carloshm/comments/9523361.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloshm/commentrss.aspx?PostID=9523361</wfw:commentRss><description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;If you have read my &lt;A title="How to: Programmatically Export the Crawl History to a CSV File in PowerShell " href="http://blogs.msdn.com/carloshm/archive/2009/03/31/how-to-programmatically-export-the-crawl-history-to-a-csv-file-in-powershell.aspx" mce_href="http://blogs.msdn.com/carloshm/archive/2009/03/31/how-to-programmatically-export-the-crawl-history-to-a-csv-file-in-powershell.aspx"&gt;previous post&lt;/A&gt; you may think, why did you stop there? Well, that is what I thought too&amp;nbsp;:), and started with &lt;A title="How to: Programmatically Manage the Crawl of a Content Source" href="http://msdn.microsoft.com/en-us/library/aa679491.aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa679491.aspx"&gt;this article&lt;/A&gt; from MSDN.&lt;/P&gt;
&lt;P&gt;We wanted to start managing the crawling of our content source more programmatically, as we have seen that running several at the same time affects the overall process.&lt;/P&gt;
&lt;P&gt;So running these powershell scripts as scheduled task and monitoring the status can improve in crawling.&lt;/P&gt;
&lt;P&gt;You may improve them reusing the context and content sources and&amp;nbsp;doing some &lt;EM&gt;pipeline&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to be included in the overall file:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;## SharePoint Reference&lt;BR&gt;[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") &lt;BR&gt;[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") &lt;BR&gt;[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search.Administration") &lt;BR&gt;[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search") &lt;BR&gt;[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server") &lt;BR&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;To start an incremental crawl of the content source&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;function global:StartIncremental-Crawl($url, $csname)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;trap [Exception] {&lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.GetType().FullName); &lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.Message); &lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;continue;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s = new-Object Microsoft.SharePoint.SPSite($url);&lt;BR&gt;&amp;nbsp;$c = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($s);&lt;BR&gt;&amp;nbsp;$sc = new-Object Microsoft.Office.Server.Search.Administration.Content($c);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$cs = $sc.ContentSources[$csname];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$cs.StartIncrementalCrawl();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s.Dispose();&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;StartIncremental-Crawl -url &lt;A href="http://your_site_url/"&gt;http://your_site_url&lt;/A&gt; -csname "your content source name"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;To start a full crawl of the content source&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;function global:StartFull-Crawl($url, $csname)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;trap [Exception] {&lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.GetType().FullName); &lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.Message); &lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;continue;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s = new-Object Microsoft.SharePoint.SPSite($url);&lt;BR&gt;&amp;nbsp;$c = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($s);&lt;BR&gt;&amp;nbsp;$sc = new-Object Microsoft.Office.Server.Search.Administration.Content($c);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$cs = $sc.ContentSources[$csname];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$cs.StartFullCrawl();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s.Dispose();&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;StartFull-Crawl -url &lt;A href="http://your_site_url/"&gt;http://your_site_url&lt;/A&gt; -csname "your content source name"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;To pause a crawl in process&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;function global:Pause-Crawl($url, $csname)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;trap [Exception] {&lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.GetType().FullName); &lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.Message); &lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;continue;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s = new-Object Microsoft.SharePoint.SPSite($url);&lt;BR&gt;&amp;nbsp;$c = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($s);&lt;BR&gt;&amp;nbsp;$sc = new-Object Microsoft.Office.Server.Search.Administration.Content($c);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$cs = $sc.ContentSources[$csname];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$cs.PauseCrawl();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s.Dispose();&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;Pause-Crawl -url &lt;A href="http://your_site_url/"&gt;http://your_site_url&lt;/A&gt; -csname "your content source name"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;To resume a paused crawl&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;function global:Resume-Crawl($url, $csname)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;trap [Exception] {&lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.GetType().FullName); &lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.Message); &lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;continue;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s = new-Object Microsoft.SharePoint.SPSite($url);&lt;BR&gt;&amp;nbsp;$c = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($s);&lt;BR&gt;&amp;nbsp;$sc = new-Object Microsoft.Office.Server.Search.Administration.Content($c);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$cs = $sc.ContentSources[$csname];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$cs.ResumeCrawl();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s.Dispose();&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;Resume-Crawl -url &lt;A href="http://your_site_url/"&gt;http://your_site_url&lt;/A&gt; -csname "your content source name"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;To stop a crawl of the content source&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;function global:Stop-Crawl($url, $csname)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;trap [Exception] {&lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.GetType().FullName); &lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.Message); &lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;continue;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s = new-Object Microsoft.SharePoint.SPSite($url);&lt;BR&gt;&amp;nbsp;$c = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($s);&lt;BR&gt;&amp;nbsp;$sc = new-Object Microsoft.Office.Server.Search.Administration.Content($c);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$cs = $sc.ContentSources[$csname];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$cs.StopCrawl();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s.Dispose();&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;Stop-Crawl -url &lt;A href="http://your_site_url/"&gt;http://your_site_url&lt;/A&gt; -csname "your content source name"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;To check the crawl status values for a content source&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;function global:Get-CrawlStatus($url)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;trap [Exception] {&lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.GetType().FullName); &lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.Message); &lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;continue;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s = new-Object Microsoft.SharePoint.SPSite($url);&lt;BR&gt;&amp;nbsp;$c = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($s);&lt;BR&gt;&amp;nbsp;$sc = new-Object Microsoft.Office.Server.Search.Administration.Content($c);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Write-Output $sc.ContentSources;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s.Dispose();&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;Get-CrawlStatus -url &lt;A href="http://your_site_url/"&gt;http://your_site_url&lt;/A&gt; | Format-Table -property CrawlStatus, CrawlStarted, CrawlCompleted&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Enjoy!&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9523361" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/carloshm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/Codeplex/default.aspx">Codeplex</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/Search/default.aspx">Search</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>How to: Programmatically Export the Crawl History to a CSV File in PowerShell</title><link>http://blogs.msdn.com/carloshm/archive/2009/03/31/how-to-programmatically-export-the-crawl-history-to-a-csv-file-in-powershell.aspx</link><pubDate>Tue, 31 Mar 2009 18:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9523116</guid><dc:creator>carloshm</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/carloshm/comments/9523116.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloshm/commentrss.aspx?PostID=9523116</wfw:commentRss><description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;When I came across the article at MSDN &lt;A title="Crawl History to a CSV" href="http://msdn.microsoft.com/en-us/library/cc789570.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc789570.aspx"&gt;How to: Programmatically Export the Crawl History to a CSV File&lt;/A&gt;&amp;nbsp;I thought I would never create such a tool just for that specific feature, as you end up with additional requirements in order to create an admin tool.&lt;/P&gt;
&lt;P&gt;But today I needed to get data from crawl history, and I didn't want to get them from SQL (remember it is not supported ;)&lt;A title=comment01_carloshm name=comment01_carloshm&gt;&lt;/A&gt;), so I started to write down a simple powershell script to do it. And then I realized that for this atomic actions, indeed it is a great options!: you give admin people multiple commands that they can use/combine to monitor/get information about the environment (and yes many, many things more)&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;## SharePoint Reference&lt;BR&gt;[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") &lt;BR&gt;[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") &lt;BR&gt;[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search.Administration") &lt;BR&gt;[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search") &lt;BR&gt;[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server") &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;function global:Get-CrawlHistory($url)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;trap [Exception] {&lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.GetType().FullName); &lt;BR&gt;&amp;nbsp;&amp;nbsp;write-error $("ERROR: " + $_.Exception.Message); &lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;continue;&amp;nbsp; &amp;nbsp;&lt;BR&gt;&amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s = new-Object Microsoft.SharePoint.SPSite($url);&lt;BR&gt;&amp;nbsp;$c = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($s);&lt;BR&gt;&amp;nbsp;$h = new-Object Microsoft.Office.Server.Search.Administration.CrawlHistory($c);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Write-OutPut $h.GetCrawlHistory();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;$s.Dispose();&lt;BR&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then you can just execute: Get-CrawlHistory -url &lt;A href="http://your_site_url/"&gt;http://your_site_url/&lt;/A&gt; | &lt;A title=Export-Csv href="https://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/export-csv.mspx" mce_href="https://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/export-csv.mspx"&gt;Export-Csv&lt;/A&gt; your_path_and_file_name&lt;/P&gt;
&lt;P&gt;Then you can import to excel and make some charts.&lt;/P&gt;
&lt;P&gt;In order to filter the information some useful columns should be denormalized: CrawlType, ContentSourceID, Status.&lt;/P&gt;
&lt;P&gt;Cheers!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9523116" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/carloshm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/Codeplex/default.aspx">Codeplex</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/Search/default.aspx">Search</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>Inside SharePoint - Customize the Mobile Home Page</title><link>http://blogs.msdn.com/carloshm/archive/2008/12/30/inside-sharepoint-customize-the-mobile-home-page.aspx</link><pubDate>Tue, 30 Dec 2008 02:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9256348</guid><dc:creator>carloshm</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/carloshm/comments/9256348.aspx</comments><wfw:commentRss>http://blogs.msdn.com/carloshm/commentrss.aspx?PostID=9256348</wfw:commentRss><description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P mce_keep="true"&gt;These days I've been reviewing different ideas I wrote down in the last months. One of those was about how to extend mobile sharepoint features. So I started re-reading the SDK, landing at &lt;A title="How to: Customize the Mobile Home Page through Redirection" href="http://blogs.msdn.com/controlpanel/blogs/How%20to:%20Customize%20the%20Mobile%20Home%20Page%20through%20Redirection" mce_href="http://blogs.msdn.com/controlpanel/blogs/How to: Customize the Mobile Home Page through Redirection "&gt;How to: Customize the Mobile Home Page through Redirection&lt;/A&gt;&amp;nbsp;article. It certainly&amp;nbsp;describes in depth the mechanism of the redirection and indeed it is a great extensibility option, however I found that there are some scenarios where it would need to implement a different approach. Some of those could be:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Use a different name for the redirection&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Differentiate the redirection process from the site definition&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Customize different home pages for sites with the same site definition&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Customize OOB sites, avoiding duplicates names&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;OOB Feature Redirection&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;From the article we can see how&amp;nbsp;this&amp;nbsp;(bi-level) redirection mechanism works:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;The mobile home page has a short URL with an "m" folder appended to the end of the regular URL (for example, &lt;A href="http://server/sites/Site/m/"&gt;http://Server/sites/Site/m/&lt;/A&gt;) that redirects the request to the mobile &lt;CODE&gt;default.aspx&lt;/CODE&gt; page.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;The default.aspx page then redirects the user to the actual home page, according to the current site definition type&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;The first step uses the &lt;SPAN class=tx&gt;&lt;STRONG&gt;Mobility Shortcut URL &lt;/STRONG&gt;feature&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;EM&gt;(FeatureID: &lt;/EM&gt;&lt;SPAN class=tx&gt;&lt;EM&gt;f41cc668-37e5-4743-b4a8-74d1db3fd8a4 - Name:&lt;/EM&gt;&lt;SPAN class=tx&gt;&lt;EM&gt;MobilityRedirect Scope:Web)&lt;/EM&gt;&lt;STRONG&gt; &lt;/STRONG&gt;creating a &lt;A title="Module - CAML" href="http://msdn.microsoft.com/en-us/library/ms460356.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms460356.aspx"&gt;Module&lt;/A&gt; that specifies the virtual path of the folder for the redirection. &lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P style="COLOR: blue" mce_keep="true"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Module Name="mobile" Url="m" Path=""&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;File Url="default.aspx" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Module&amp;gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;This will create a folder at the root level of the Site (from a virtual point of view). &lt;/P&gt;
&lt;P mce_keep="true"&gt;In order to test the OOB funcionality, you will need to:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Activate MobilityRedirect feature (it is not activated by default) through the command line as it is hidden.&lt;/DIV&gt;&lt;/LI&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;stsadm -o activatefeature -name MobilityRedirect -url &lt;A href="http://server/sites/Site"&gt;http://Server/sites/Site&lt;/A&gt; &lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;To test if it is activated browse to &lt;A href="http://server/sites/Site/m/"&gt;http://Server/sites/Site/m/&lt;/A&gt; &lt;/DIV&gt;&lt;/LI&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;If it is working it will redirect yout to a page that looks like figure 1, otherwise it will give you a 404 error&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;/OL&gt;
&lt;P&gt;figure 1&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 371px; HEIGHT: 352px" title="Mobile View Sample from Publishing SharePoint Portal" alt="Mobile View Sample from Publishing SharePoint Portal" src="http://blogs.msdn.com/photos/carloshm/images/9256362/original.aspx" width=371 height=352 mce_src="http://blogs.msdn.com/photos/carloshm/images/9256362/original.aspx"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Custom Shortcut Feature Redirection&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;So to solve the scenarios mentioned, the new approach will use a feature to redirect to the final home page, instead of an intermediate&amp;nbsp;redirection page. The feature itself would use a custom control to read the actual final page&amp;nbsp;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;As the OOB feature uses /m/ I would not recommend the same name, as there will be collisions in activating and deactivating processes. Indeed you may find that after deactivating the feature it is still working. This would need to be resolved as part of a complete deactivation in the deactivation event.&lt;/P&gt;
&lt;P mce_keep="true"&gt;So in order to accomplish our solution, we would need to create a feature with a custom shortcut url and a custom file redirect.This scenario would be possible following these steps:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Create a folder at %PROGRAMFILES%\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES called SharePoint.Search.Extensions.MobileRedirect or any name you choose&lt;/DIV&gt;&lt;/LI&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Create a file inside this folder called &lt;STRONG&gt;feature.xml&lt;/STRONG&gt; with the following content:&lt;/DIV&gt;&lt;/LI&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV style="COLOR: blue" mce_keep="true"&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;BR&gt;&amp;lt;Feature Id="&lt;STRONG&gt;[GUID]&lt;/STRONG&gt;" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title="Mobile Redirector"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description="Mobile Redirector" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Version="1.0.0.0"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Scope="Web"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hidden="FALSE"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DefaultResourceFile="core"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns="&lt;A href="http://schemas.microsoft.com/sharepoint/"&gt;http://schemas.microsoft.com/sharepoint/&lt;/A&gt;"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ElementManifests&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ElementManifest Location="elements.xml" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ElementManifests&amp;gt;&lt;BR&gt;&amp;lt;/Feature&amp;gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Change [GUID] with a valid GUID. Something similar to 00000000-0000-0000-0000-000000000000. I would recommend you the &lt;A title=guidgen href="http://msdn.microsoft.com/en-us/library/ms241442.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms241442.aspx"&gt;guidgen&lt;/A&gt; tool from Visual Studio&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Create a file inside this folder called elements.xml with the folllowing content:&lt;/DIV&gt;&lt;/LI&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV style="COLOR: blue" mce_keep="true"&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;BR&gt;&amp;lt;Elements xmlns="&lt;A href="http://schemas.microsoft.com/sharepoint/"&gt;http://schemas.microsoft.com/sharepoint/&lt;/A&gt;"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Module Name="mobile" Url="mob" Path=""&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;File Url="default.aspx" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Module&amp;gt;&lt;BR&gt;&amp;lt;/Elements&amp;gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Create a file inside this folder called default.aspx with the following content:&lt;/DIV&gt;&lt;/LI&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV style="COLOR: blue" mce_keep="true"&gt;&lt;CODE&gt;&amp;lt;%@ Page Language="C#"&amp;nbsp;&amp;nbsp; EnableViewState="false" inherits="Microsoft.SharePoint.MobileControls.SPMobilePage, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%&amp;gt; &amp;lt;%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt; &amp;lt;%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" %&amp;gt; &amp;lt;%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt; &amp;lt;%@ Register TagPrefix="SPMobile" Namespace="Microsoft.SharePoint.MobileControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&amp;gt;&lt;BR&gt;&amp;lt;SPMobile:SPMobileForm RunAt="Server"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;SPMobile:SPMobileUrlRedirection Runat="Server" PageFileName="&lt;STRONG&gt;[DestinationPage]&lt;/STRONG&gt;" /&amp;gt;&lt;BR&gt;&amp;lt;/SPMobile:SPMobileForm&amp;gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Change [DestinationPage] with your desired destination page&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Create a file at %PROGRAMFILES%\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\MOBILE with the [DestinationPage] name.Something similar to MyNewHomePage.aspx&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Install the feature running: stsadm -o installfeature -name SharePoint.Search.Extensions.MobileRedirect&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Activate through the command line or through the UI&lt;/DIV&gt;&lt;/LI&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;stsadm -o activatefeature -name SharePoint.Search.Extensions.MobileRedirect -url &lt;A href="http://server/sites/Site"&gt;http://Server/sites/Site&lt;/A&gt; &lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Browse to &lt;A href="http://server/sites/Site/_layouts/ManageFeatures.aspx"&gt;http://Server/sites/Site/_layouts/ManageFeatures.aspx&lt;/A&gt; and click Activate for our feature&amp;nbsp;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Browse to &lt;A href="http://server/sites/Site/mob/"&gt;http://Server/sites/Site/mob/&lt;/A&gt; and check the new HomePage&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;This can be extended with some functionality/Improvements:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Include a custom control and admin page to change the &lt;STRONG&gt;[DestinationPage]&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Add localization and custom images to the feature&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Change the redirection mechanism to choose between 301 or 302 (permanent or temporary)&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Improve feature deactivation&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Of course, create a solution to deploy it&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;Finally, you can have different shortcuts changing the Url attribute of the Module node in the elements.xml file:&lt;/P&gt;
&lt;P style="COLOR: blue" mce_keep="true"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Module Name="mobile" Url="i" Path=""&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;File Url="default.aspx" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Module&amp;gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;For example: Create a new shortcut called /i/ to redirect to a IPhone version, for a customized collaborative scenario.&lt;/P&gt;
&lt;P mce_keep="true"&gt;However, in the case of a publishing site you should implement &lt;A title=Variations href="http://msdn.microsoft.com/en-us/library/ms493894.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms493894.aspx"&gt;variations&lt;/A&gt;&amp;nbsp;to target different devices.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Bye!&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9256348" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/carloshm/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/Mobile/default.aspx">Mobile</category><category domain="http://blogs.msdn.com/carloshm/archive/tags/HowTo/default.aspx">HowTo</category></item></channel></rss>