TwitterLinkedInBlog

Tuesday, October 19, 2010

FAST Search - Don't let the Byte Order Marks bite!

I recently ran into the situation described in this post:
The configuration wizard was failing on the non-admin nodes. In particular, I ran into checklist item 2, an invisible Byte Order Mark (BOM) at the beginning of the file. With the help of a friendly Microsoft engineer, I ran through the steps in checklist item 3 and the cmdlet, 'Set-FASTSearchIPSec -Create -Verbose', failed. This is described in the following kb article: http://support.microsoft.com/kb/2028971
It turned out that even though I was copying and pasting the deployment.xml using notepad to get rid of the BOM, it was the wrong copy of deployment.xml!
THE DEPLOYMENT.XML YOU MUST FIX IS LOCATED ON THE ADMIN NODE AT:
%FastSearch%\etc\config_data\deployment\deployment.xml
In order to see the BOM, or to verify that it’s gone, open the file in your favorite hex editor. I used HexEdit trial software. So think twice before using visual studio 2010 to author your FAST deployment.xml file. :)

FAST Search - Configuration Wizard Fails on Admin Node

We received the following error when attempting to run the configuration wizard on a FAST admin node (Edited for space):


StdError - resourcestoreinstaller.exe - C:\Windows\system32\inetsrv\appcmd.exe SET config "ResourceStore" /section:requestFiltering /verbs.allowUnlisted:false /commit:apphost - ERROR ( message:Unknown attribute "verbs.allowUnlisted".  Replace with -? for help. )

Exception - System.Management.Automation.RuntimeException: An error occurred while installing Resource store.


It turned out to be the number of processor on the admin node. There were 24. The limit is apparently 15. Once we reduced the number of processors to 4 in the bios, the configuration wizard completed successfully.

Tuesday, October 5, 2010

FAST Search - Failed to communicate with the WCF service

Problem: While attempting to run Get-FASTSearchMetadataCrawledProperty, I received the error, "Failed to communicate with the WCF service"

Solution: Added myself to FASTSearchAdministrators group, logged out, logged back in.

Reference: http://manish-sharepoint.blogspot.com/2010/01/wcf-service-error-while-executing.html

Monday, September 27, 2010

VS2010 - How to: Enable ECMA Client Object Model IntelliSense

http://msdn.microsoft.com/en-us/library/ff798328.aspx

<script src="/_layouts/MicrosoftAjax.js" type="text/javascript" />

<script src="/_layouts/SP.debug.js" type="text/javascript" />

<script type="text/javascript" src="/_layouts/SP.core.js" />

<script type="text/javascript" src="/_layouts/SP.UI.Dialog.js "/>

Friday, September 17, 2010

Todd Bleeker - Is that a SharePoint site?


SP2007:
http://[domain]/_layouts/images/CPVW.GIF
SP2010:
http://[domain]/_layouts/images/FGIMG.PNG

Tuesday, August 31, 2010

SP2010 - Share Link To Current Page

.aspx:
<asp:HyperLink ID="ShareHyperlink" runat="server" Text="Share" ToolTip="Share" />

function shareLinkInEmail(subject, body) {
var escapedSubject = escapeProperly(subject);
var escapedBody = escapeProperly(body);
window.location='mailto:?subject=' + escapedSubject + '&body=' + escapedBody;
}

c#:
ShareHyperlink.NavigateUrl = "javascript:shareLinkInEmail('Testing', 'Testing' + String.fromCharCode(13) + '" + Request.Url.Scheme + "://" + Request.Url.Host + ":" + Request.Url.Port + Request.RawUrl + "');";

Thursday, August 26, 2010

SP2010 - Sunil Yadav - Developer Dashboard

Copied and pasted directly from Sunil Yadav ...
http://www.sunilyadav.net/?tag=developer-dashboard-powershell
... because I'm tired of googling and finding outdated beta techniques.

The developer dashboard is the new feature addition to SPS 2010 diagnostics. The Developer dashboard provides detailed information such as components generating load on the system, code that executed on the page, query execution time, function by function level trace, WebPart load time etc.

Developer Dashboard Modes:
  1. On : Developer Dashboard is viewable on all pages that use the default master page.
  2. Off : Turns off the Developer Dashboard.
  3. OnDemand : Allows the user to toggle the Dashboard on and off.

The Developer Dashboard is disabled by default. One can enable the Developer Dashboard with the help of following methods.

1. Using STSADM.EXE
STSADM.exe -o setproperty -pn developer-dashboard -pv OnDemand

2. Using PowerShell
Open SharePoint 2010 Management Shell
Run following script on the Sharepoint 2010 Management Shell.
$devdashboard =[Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
$devdashboard.DisplayLevel = 'OnDemand';
$devdashboard.Update()

3. Using Object Model
SPWebService service = SPWebService.ContentService;
service.DeveloperDashboardSettings.DisplayLevel=Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel.OnDemand;
service.Update();

Monday, August 23, 2010

VS2010 - Sahil Malik - Strong Name

Reference: Sahil Malik's blog: http://blah.winsmarts.com/2009-12-SharePoint_Productivity_Tip_of_the_day.aspx

This is an improvement over the sn.exe technique which only give you the public key token. Sahil's technique gives you output you can copy and paste directly into an assembly attribute.

Visual Studio > Tools > External Tools > Add > Title: S&trong Name; Command: Powershell.exe; Arguments: -command "[System.Reflection.AssemblyName]::GetAssemblyName(\"$(TargetPath)\").FullName"; Use Output Window: Check > OK.

Friday, August 6, 2010

Browser Web Development Tools

Internet Explorer 8 (ie8):
F12 -or- Alt > Tools > Developer Tools

Safari:
Alt >Edit > Preferences... > Advanced > Show Develop menu in menu bar.
Ctrl+Alt+I -or- Alt > Develop > Show Web Inspector.

Firefox:
Install Firebug (http://getfirebug.com/)
F12 -or- Alt > Tools > Firebug > Open Firebug

Friday, July 30, 2010

Telerik - Override Embedded WebResource.axd CSS

Required reading:
http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/css-from-telerik-web-ui-webresource-axd-is-overriding-css-for-custom-skin.aspx

In a nutshell (In case the link expires):
Increase the specificity for each class in the custom theme. This usually consists of a simple Find & Replace of .RadYourControl with div.RadYourControl.

Thursday, July 22, 2010

SP2010 PowerShell - Create a wiki library and set the default welcome page

SP2010 PowerShell - Create a wiki library and set the default welcome page

$web = get-spweb(http://myserver/sites/mysite)
$listTemplate = "WebPageLibrary"
$listDescription = "My Wiki"
$listName = "MyWiki"
$list_template = [System.Enum]::Parse([Microsoft.SharePoint.SPListTemplateType], $listTemplate)
$lists = $web.Lists
$lists.Add($listName, $listDescription, $list_Template)
$wiki = $web.GetList("/sites/mysite/" + $listName);
$rootFolder = $wiki.RootFolder
$rootFolder.WelcomePage = "MyHome.aspx"
$rootFolder.Update()

Wednesday, June 23, 2010

Windows Server 2008 - User Account Control

Start > Control Panel > User Accounts > User Accounts > Change User Account Control settings > Never notify > OK.

Thursday, June 17, 2010

Windows Server 2008 - Show thumbnails instead of icons

Start > Run > SystemPropertiesPerformance > Show thumbnails instead of icons > OK.

Wednesday, June 16, 2010

VS2010 - How to use the 'Go To Find Combo' to find a file in your Visual Studio Solution

How to add the Go To Find Combo if it is missing from the Standard Toolbar:

Visual Studio > Standard Toolbar > Standard Toolbar Options > Add or Remove Buttons > Customize... > Commands (tab) > Toolbars: Standard > Add Commands... > Categories: Edit, Go To Find Combo > OK > Move Down (Optional) > Close.

How to use the Go To Find Combo to find a file in your Visual Studio Solution:

Use the following pattern (Without single quotes):
'>of sampleFileName'

Wednesday, June 2, 2010

SP2007 - DisableLoopbackCheck

Win+R > regedit > HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters > Edit > New > DWORD Value > DisableStrictNameChecking > Modify > 1 > OK > Alt+F4 > Restart

Win+R > regedit > HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0 > Edit > New > Multi-String Value > BackConnectionHostNames > Modify > (Enter each host header on a separate line. Examples include connect.contoso.com or devvm) > OK > Alt+F4 > Restart (Despite claims that you may simply restart IISAdmin Service)

Resources:
DisableLoopbackCheck & SharePoint: What every admin and developer should know.
Groundhog Day: Configuring Back Connection Host Names using Group Policy
DisableLoopbackCheck? Let's do it the right way
http://support.microsoft.com/kb/896861

Wednesday, March 17, 2010

SP2007 - Shared Services Access Denied

Shared Services Admin Site > Personalization services permissions > Add Users/Groups > check appropriate

Wednesday, March 3, 2010

VS2008 - Get SN Token

Tools > External Tools > Add > Title: Get SN Token, Command: c:\program files\microsoft sdks\windows\v6.0a\bin\sn.exe, Arguments: -T $(TargetPath), Use output window: yes

Resources:
http://blogs.msdn.com/miah/archive/2008/02/19/visual-studio-tip-get-public-key-token-for-a-stong-named-assembly.aspx

Monday, March 1, 2010

SP2007 - Forms Based Authentication (FBA)

Frakking FBA! Get Bill Gates in here!

Create the ASP.NET Membership Database:
Win+R > C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe > Next > Configure SQL Server for application services > Next > Server: mossserver, Database: fba_db > Next > Next > Finish

User and Role Creation:
Create a new folder on your desktop called 'FBA Management Site' > VS2008 > File > Open > Website... > [Browse to new folder on desktop] > Open > Website > Add New Item > Web Configuration File > Add

<connectionStrings>
  <add name="FbaConnectionString" connectionString="server=mossserver;database=fba_db;Trusted_Connection=true" />
</connectionStrings>
<system.web>
<membership defaultProvider="FbaMemberProvider">
  <providers>
    <add connectionStringName="FbaConnectionString"
      applicationName="/" name="FbaMemberProvider"
      type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
</membership>
<roleManager enabled="true" defaultProvider="FbaRoleProvider">
  <providers>
    <add connectionStringName="FbaConnectionString" applicationName="/"
      name="FbaRoleProvider"
      type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
</roleManager>

Website > ASP.NET Configuration > Security tab > Select Authentication Type > From the Internet > Security tab > Create or manage roles > fbaadmins > Security tab > Create user > fbaadmin

Configure Central Administration web.config:
<PeoplePickerWildcards>
  <add key="FbaMemberProvider" value="%" />
</PeoplePickerWildcards>
...
<connectionStrings>
  <add name="FbaConnectionString" connectionString="server=mossserver;database=fba_db;Trusted_Connection=true" />
</connectionStrings>
<system.web>
<membership defaultProvider="FbaMemberProvider">
  <providers>
    <add connectionStringName="FbaConnectionString" applicationName="/" name="FbaMemberProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
</membership>
<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider">
  <providers>
    <add connectionStringName="FbaConnectionString" applicationName="/" name="FbaRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
</roleManager>

Configure Target Site web.config:
<PeoplePickerWildcards>
  <add key="FbaMemberProvider" value="%" />
</PeoplePickerWildcards>
...
<connectionStrings>
  <add name="FbaConnectionString" connectionString="server=mossserver;database=fba_db;Trusted_Connection=true" />
</connectionStrings>
<system.web>
<membership defaultProvider="FbaMemberProvider">
  <providers>
    <add connectionStringName="FbaConnectionString" applicationName="/" name="FbaMemberProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
</membership>
<roleManager enabled="true" defaultProvider="FbaRoleProvider">
  <providers>
    <add connectionStringName="FbaConnectionString" applicationName="/" name="FbaRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
</roleManager>

Configure ASP.NET Membership Database:
Verify that the App Pool Identity accounts for Central Administration and the Target Site have at least Read rights to the fba_db database:
SQL Server Management Studio > mossserver > Databases > fba_db > Security > right-click Users > New User... > Login name: [App Pool Identity account], User name: [App Pool Identity account w/out domain] > Database role membership: > check all Role Members with prefix aspnet_

Configure the Zone's Provider:
Central Administration > Application Management > Authentication Providers > [Select Target Web Application] > Default > Authentication Type: Forms, Enable anonymous access: No, Membership Provider Name: FbaMemberProvider, Role manager name: FbaRoleProvider, Enable Client Integration? No > Save

Configure Policy for Target Web Application:
Central Administration > Application Management > Policy for Web Application > Add Users > [Select Target Web Application] > Zones: Default > Next > Users: fbaadmins; fbaadmin, Permissions: Full Control > Finish

Configure Site Collection Administrators:
Central Administration > Application Management > Site Collection Administrators > [Select target web application] > Primary site collection administrator: fbaadmin > OK

Login:
Navigate to the target web application and login as fbaadmin.

Resources:
http://www.simple-talk.com/dotnet/windows-forms/configuring-forms-authentication-in-sharepoint-2007/

http://msdn.microsoft.com/en-us/library/bb975136.aspx

http://www.devcow.com/blogs/jdattis/archive/2007/02/23/Office-SharePoint-Server-2007-Forms-Based-Authentication-FBA-Walkthrough-Part-1.aspx

http://www.devcow.com/blogs/jdattis/archive/2007/03/01/Office-SharePoint-Server-2007-Forms-Based-Authentication-FBA-w-MySites-Walkthrough-Part-2.aspx

http://www.devcow.com/blogs/jdattis/archive/2008/03/10/forms-based-authentication-application-pool-account-permissions.aspx

CKS FBA:
http://cks.codeplex.com/releases/view/17901

Thursday, February 18, 2010

SP2007 - Diagnostic Logging Settings

SharePoint 2007 > Central Administration > Operations

Optimal Settings (RDA):
Diagnostic Logging > Event Throttling > Select a category > All > Least critical event to report to the event log > Error > Least critical event to report to the trace log > High > OK

Diagnostic Logging > Event Throttling > Select a category > MS Search Administration > Least critical event to report to the event log > Error > Least critical event to report to the trace log > Monitorable > OK

Diagnostic Logging > Event Throttling > Select a category > Setup & Upgrade > Least critical event to report to the event log > Error > Least critical event to report to the trace log > Monitorable > OK

Debug Settings (Andrew Connell):
Diagnostic Logging > Event Throttling > Select a category > All > Least critical event to report to the trace log > Verbose
Trace Log > Number of log files > 5 > Number of minutes to use a log file > 3

Wednesday, January 20, 2010

VS2008 - Format XML Document

Edit > Advanced > Format Document

Monday, January 18, 2010

SP2007 - Event Handler AfterProperties DateTime

...
using Microsoft.SharePoint.Utilities
...

// THIS WORKS:
DateTime taskDueDate = Convert.ToDateTime(properties.ListItem[TASK_DUE_DATE_INTERNAL_FIELD_NAME]);

// THIS DOES NOT WORK:
// DateTime taskDueDateAfter = Convert.ToDateTime(properties.AfterProperties[TASK_DUE_DATE_INTERNAL_FIELD_NAME]);

// USE THIS INSTEAD:
string taskDueDateAfterString = properties.AfterProperties[TASK_DUE_DATE_INTERNAL_FIELD_NAME].ToString();
DateTime taskDueDateAfter = SPUtility.CreateDateTimeFromISO8601DateTimeString(taskDueDateAfterString);

Friday, January 15, 2010

SP2007 - SPUser SPFieldUserValue Event Handler

    bool isUserAuthor = false;

    if (properties.ListItem[AUTHOR_INTERNAL_FIELD_NAME] != null)
    {
        SPFieldUserValue authorFieldValue = new SPFieldUserValue(properties.OpenWeb(), properties.ListItem[AUTHOR_INTERNAL_FIELD_NAME].ToString());

        if (authorFieldValue.User.LoginName == properties.UserLoginName)
        {
            isUserAuthor = true;
        }
    }

Thursday, January 14, 2010

SP2007 Quick Launch - Link that opens in new browser window

Site Actions > Site Settings > Quick Launch > New Link > Url > javascript:void window.open('http://www.google.com','_blank');

Relative URLs work as well.