Find bottlenecks in Windows 7

From what we've seen so far Windows 7 is already performing better than Vista, but if your PC seems sluggish then it's now much easier to uncover the bottleneck. Click Start, type RESMON and press Enter to launch the Resource Monitor. Click the CPU, Memory, Disk or Network tabs. Windows 7 will immediately show which processes are hogging the most system resources.

The CPU view is particularly useful, and provides something like a more powerful version of Task Manager. If a program has locked up, for example, then right-click its name in the list and select Analyze Process. Windows will then try to tell you why it's hanging - the program might be waiting for another process, perhaps - which could give you the information you need to fix the problem.

Cannot move, hide, or add anything in SharePoint navigation menu

Yesterday I have witnessed a very weird behaviour of SharePoint navigation menu. Basically, SharePoint refused to save any changes (add/remove, hide, move, etc.) to SharePoint navigation menu. To make things even more confusing, it did not throw any errors or warnings in the event logs or SharePoint logs when this happened! In the process of troubleshooting this problem, we have systematically eliminated navigation provider(s), master pages, pages layouts, web.config(s), etc. as a potential source of this problem. We have checked everything and we're not able to come even close to finding a solution. Just before we started to plan on rebuilding the entire SharePoint environment to solve the problem, we have (almost accidently) found what was causing the problem. It turns out that what was causing this weird behaviour is that a default value of a single Boolean variable (_spSuppressFormOnSubmitWrapper) in INIT.JS file was changed from FALSE to TRUE. This almost makes sense, but... If you change the default behaviour of the submit button, shouldn't this change for effect the entire SharePoint environment, instead of singling only the navigation menu? Weird?! I am glad the problem was resolved though J

Change SharePoint Service Accounts

Change SharePoint Central Administration Account

  1. On servers running SharePoint Central Administration site run the following command:
    stsadm -o updatefarmcredentials -userlogin DOMAIN\USERNAME -password PASSWORD
  2. On other servers not running SharePoint Central Administration site run the following command:
    stsadm -o updatefarmcredentials -userlogin DOMAIN\USERNAME -password PASSWORD -local
  3. Run iisreset /noforce to restart IIS
  4. To make sure that this operation completed, open SharePoint Central Administration site >> Operations >> Timer job definitions and wait until Administration Application Pool Credential Deployment timer job disappears from the list.

Change Application Pool Accounts

There are two ways to change application pool accounts in SharePoint: first one using GUI, and the second using STSADM command. To change application pool accounts using GUI:

  • Open SharePoint Central Administration site >> Operations >> Service Accounts (under Security Configuration section)
  • Select Web Application Pool option and pick Web Service and Application Pool you would like to make changes to
  • Enter username and password for application pool service account.
  • You need to do this for each application pool account you would like to change on every SharePoint server in your farm

To change application pool account using STSADM command, run:

stsadm -o updateaccountpassword -userlogin DOMAIN\USERNAME -password PASSWORD –noadmin

Once again, you need to do this for each application pool account you would like to change on every SharePoint server in your farm.

There is also a third way to change application pool account – using LaPointe's custom STSADM command extensions: http://stsadm.blogspot.com/2008/10/changing-application-pool-identity-via.html

To change application pool account for SharePoint Central Administration web application run:

stsadm -o updatefarmcredentials -userlogin DOMAIN\USERNAME -password PASSWORD

 

Change Windows SharePoint Services Help Search account

To change Windows SharePoint Services Help Search account, run:

stsadm -o spsearch -farmserviceaccount DOMAIN\USERNAME -farmservicepassword PASSWORD

Change Default content access account (used by the Windows SharePoint Services Help Search service)

To change Default Content Access account, run:

stsadm -o spsearch -farmcontentaccessaccount DOMAIN\USERNAME -farmcontentaccesspassword PASSWORD

Change Office SharePoint Server Search service account

To change Office SharePoint Server Search account, run:

stsadm -o osearch -farmserviceaccount DOMAIN\USERNAME -farmservicepassword PASSWORD

Change Default content access account (used by the Shared Service Provider)

To change Default Content Access account, if the Infrastructure Update for Microsoft Office Servers is installed:

  • Open SharePoint Central Administration site, click on your Shared Services Provider (in the Quick Launch, in the Shared Services Administration group)
  • On the Shared Services Administration page, in the Search section, click Search Administration.
  • On the Search Administration page, on the Quick Launch, in the Crawling section, click Default content access account
  • On the Default Content Access Account page, in the Account box, type the domain and user name for the account (in the form DomainName\UserName)
  • In the Password and Confirm Password boxes, type the password for the account.
  • Click OK.

To change Default Content Access account, if the Infrastructure Update for Microsoft Office Servers is not installed:

  • Open SharePoint Central Administration site, click on your Shared Services Provider (in the Quick Launch, in the Shared Services Administration group)
  • On the Shared Services Administration page, in the Search section, click Search Settings.
  • On the Configure Search Settings page, in the Crawl Settings section, click Default content access account
  • On the Default Content Access Account page, in the Account box, type the domain and user name for the account (in the form DomainName\UserName)
  • In the Password and Confirm Password boxes, type the password for the account.
  • Click OK.

You can also use crawl rules to specify a different content access account or authentication method, read more at http://technet.microsoft.com/en-us/library/cc263052.aspx.

Change Shared Service Provider Service Accounts

To change Shared Service Provider Service Accounts, run:

stsadm -o editssp -title SHAREDSERVICESPROVIDERNAME -ssplogin DOMAIN\USERNAME -ssppassword PASSWORD

You need to run this command on every SharePoint server in your farm.

Change Excel Services Account

To change Excel Services Account:

  1. Open SharePoint Central Administration site, click on your Shared Services Provider
  2. Click edit Excel Services settings
  3. Enter username and password for the Excel Calculation Services account and then click the OK button.

Change Profile Access account

  1. Open SharePoint Central Administration site, click on your Shared Services Provider
  2. Click User profiles and properties
  3. Click Configure profile import
  4. Enter username and password and then click the OK button

SharePoint deployment jobs are off by 3 hours

One of the beautiful things about SharePoint is that you can schedule the time when you want your solution to be deployed or your page to be published. Recently, I have noticed that on one of our SharePoint farms, all deployment jobs were off by 3 hours. Naturally, I suspect that this problem must be caused by time zone misconfiguration. Obvious, right? What wasn't obvious is that to get this problem fixed you have to make sure that your time zone settings match in three separate places:

  1. Under local regional settings on your server (Do'h)
  2. Under Web Application General Settings (in SharePoint Central Administration >> Application Management). Ideally, all your web application will use the same time zone.
  3. Under Regional Settings in Site Settings for the specific site you're working with.

 

I realize that this is fairly small and easy to fix problem. But I just hate these annoying little problems that interrupt my afternoon nap... now back to sleep, I mean work J

Building public-facing websites using SharePoint 2007: SEO best practices

This is a fourth and final post of the blog post series on building public-facing websites using SharePoint 2007. The first part was dedicated to the planning building public-facing websites using SharePoint 2007. The second part was dedicated to custom branding and development in SharePoint. The third blog post of the series was dedicated to search functionality in SharePoint. Let's start...

 

PAGE CONTENT

To me fresh and relevant content is the single most important aspect that defines your SEO rankings. You must strive to keep the content of your website fresh and read worthy. Take advantage SharePoint workflows and content expiration features to make it easier to generate new content. And, yes, having more text on the page is better than having more images.

Page Title is very important from SEO perspective. It absolutely must be descriptive and to the point. If you have to add your company name to the page title, add it to the end of the page title and separate it with double dashes "--" or something. Please try to avoid naming all pages in the site with the same page title.

Page Description must clearly summarize in one or two sentences what the page is about.

Even though keywords are not as important as they used to be (partially because keywords have been abused in the past.) So, it's up to if you want to use them or not. Personally, I don't.

 

PROPER HTML TAGGING

From my experience, the following HTML tags are important from SEO perspective:

  • H1, H2, H3 ….
  • Title
  • Alt parameters for IMG
  • META tags (maybe)

 

SEO-friendly URLs

Having SEO-friendly URLs is one of the easiest ways to get higher SEO rankings. As long as your page URL contains relevant keywords your page will have high(er) SEO ranking. It is amazing how something this simple can be so important. Use Imtech SharePoint SEO Slugs Feature to get Sharepoint build SEO friendly URL automatically when you create new page(s).

 

Sitemaps and robots.txt

Sitemap is a simple XML file describing the structure and the hierarchy of your website a search engine. It also provides the mechanism for letting search engines know when your pages have been added, removed or otherwise modified. You are supposed to use update your sitemap file every time you add a page, and ideally you should do that for every major search engine. To make things easier, use SharePoint SiteMap Generator.

As with any other public facing website, you should add robots.txt to your website to make sure that search engines do not crawl the sections of the site that you do not want them to. Here is an example of robots.txt file:

User-Agent: *

Disallow: /Search/

Disallow: /_layouts/

Dissalow: /ReusableContent/

Dissalow: /WorkflowTasks/

Dissalow: /SiteCollectionDocuments/

Dissalow: /SiteCollectionImages/

Dissalow: /Documents/Forms/

Dissalow: /Pages/Forms/

 

sitemap: http://www.SHAREPOINTSITE.com/sitemap.xml

 

 

Handling page redirects properly

It is very important to properly handle all your 404 errors. If you have any pages that have been moved or deleted, you must properly handle the HTTP request using URL rewriter and 301 permanent redirects. Here is a sample of the code from MSDN how to do that: http://msdn.microsoft.com/en-us/library/cc721591.aspx

To verify that your URLs return proper HTTP header, use URI Valet.

 

Handy SEO tools for SharePoint

  • Imtech SharePoint SEO Slugs Feature: Imtech SharePoint SEO Slugs is a SharePoint Feature which hooks up to the Create Page Application Page provided with MOSS 2007. While creating a slug it not only separates all the different words with a hyphen (-) but also removes all the stop words as well!
  • SharePoint SiteMap Generator: the process of keeping your site's sitemap.xml file current
  • URI Valet: an online tool to check what HTTP header your URL returns.

 

As I have already mentioned in my previous blog post, ObjectSharp has been working with SharePoint technologies for years now: building public facing websites and intranet for clients, developing custom SharePoint web parts and features, designing custom templates, and so on... Oh yes, I forgot to mention hundreds of hours of SharePoint training (public and private) for developers and power users that we have taught to our clients. So, if you need any help customizing your SharePoint in any way, please email our Client Services Manager, Gisele Bourque, at gbourque@objectsharp.com, and/or if you need any training on SharePoint technologies email our Training Manager, Julie James, at jjames@objectsharp.com. Or visit our new and fancy SharePoint-based website at http://www.objectsharp.com.



Related resources:

My first TSPUG presentation on how to build public facing websites using SharePoint

On June 17, 2009, I will have my first talk at Toronto SharePoint User Group. The topic of the presentation is "Using SharePoint for Public Facing Websites". This presentation will cover (or attempt to cover) the best practices for building public facing websites using SharePoint, as well "gotchas" that I have came across working with SharePoint over the years. If interested, please come along…

Toronto SharePoint User Group usually meets 2 Bloor Street West, 12th Floor, Toronto (Bloor-Yonge subway station). Attendees tend to arrive at 6pm, grab a bite and socialize, meeting starts at 6:30 with Q&A, and the presentation starts by 7pm. The presentation wraps at about 8:20 or 8:30 and we end with prizes for the last 10pm. Some people get together for a beer after the meeting, but it's optional…

Please RSVP to Susie Ibbotson at sibbotson@nonlinear.ca if you're coming, in order to make sure that we order enough pizza J

Building public-facing websites using SharePoint 2007: search functionality

This is a third post of the blog post series on building public-facing websites using SharePoint 2007. The first part was dedicated to the planning building public-facing websites using SharePoint 2007. The second part was dedicated to custom branding and development in SharePoint.

Plan SharePoint search: performance and sizing

Here is an excellent post on planning performance and sizing for SharePoint search: http://blogs.msdn.com/joelo/archive/2006/12/01/perf-and-sizing-data-from-msw-enterprise-search.aspx

Customize search box

To customize search box in SharePoint:

  • Search for PlaceHolderSearchArea in the code
  • Change Visible property of PlaceHolderSearchArea section to False: visible="false"
  • Add Search Box web part
  • To hide search scope drop down, add <DropDownModeEx xmlns="urn:schemas-microsoft-com:SearchBoxEx">HideScopeDD</DropDownModeEx> tag to the Search Box web part section of the code. More options for Search Scope Drop Down can be found at http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.portal.webcontrols.dropdownmodes.aspx
  • To hide Advanced Search option, add <Property Name="ShowAdvancedSearch">false</Property> tag to the Search Box web part section of the code
  • To change images for search buttons, modify GoImageUrl, GoImageUrlRTL, GoImageActiveUrl, GoImageActiveUrlRTL tags
  • There are a lot more things you can customize in the Search Box, just read through the tags within PlaceHolderSearchArea section

There is also another way to customize search box by modifying SearchArea.xml under C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\OSearchEnhancedFeature. This is a much less elegant way, but it works.

Clean up your SharePoint search results.

To remove noisy search results that users do not want and/or do not have permissions to see:

  • Open your Shared Services Provider
  • Click on Search Settings >> Crawl Rules
  • Add crawl rules to exclude the following paths:
    • *://*webfldr.aspx*
    • *://*my-sub.aspx*
    • *://*mod-view.aspx*
    • *://*allitems.aspx*
    • *://*all forms.aspx*
    • *://*/lists/*
    • *://*DispForm.aspx*

Permissions issues with search

I have already blogged about some permissions issues with SharePoint search and anonymous users. Basically it has to do with the page layout inheriting certain classes that are not accessible to the anonymous users, but you can read the rest in my previous blog post: http://blogs.objectsharp.com/CS/blogs/max/archive/2008/02/20/sharepoint-search-and-anonymous-users.aspx

Block search engines from crawling non-public parts of the website

Activate ViewFormsPagesLockDown feature. This is a MOSS-only feature that disallows anonymous access to pages in the _layouts directory that inherit from LayoutsPageBase and disallows anonymous access any of the form or view pages (DispForm.aspx, AllItems.aspx). Otherwise, search engines will be able to view/crawl the parts of SharePoint you don't want them to see.

Best bets/Keyword feature

Use best bets feature in SharePoint search. Even though the interface is a bit awkward, I find this feature quite useful. Here are the instructions on how to manage best bets/keywords: http://office.microsoft.com/en-us/sharepointserver/HA011605771033.aspx

Performance optimization

Here are the best practices for search in SharePoint: http://technet.microsoft.com/en-us/library/cc850696.aspx.

The next topic of this blog post series will be dedicated to implementing or preserving SEO practices in SharePoint…



Related resources:

A tiny bug in Service Pack 2 of MOSS 2007 and WSS 3.0

A tiny bug in Service Pack 2 of MOSS 2007 and WSS 3.0 has been discovered recently. Installing SP2 changes a product expiration date and sets your SharePoint install to 180-day trial. This expiration date bug should not affect the normal function of SharePoint, at least until the expiration date passes. After 180-day trial expires, customer's data, configuration or application code will still not be affected, but will render SharePoint inaccessible for end-users.

Microsoft promised a hotfix for this bug within the next 48 hours or so (KB971620). Meanwhile, you can easily fix this problem by re-entering your license key:

  • Open SharePoint Central Administration
  • Go to Operations
  • Under Upgrade and Migration section, click on Convert license type
  • Type in your license key and hit Enter
  • That's it, problem solved.

Using ADFS with SharePoint

To configure Active Directory Federation Services (ADFS) to work with SharePoint follow these instructions:

I have to say that it's awesome that we can configure SharePoint to use ADFS for user authentication as eases the burden on the SharePoint users because they don't have to remember another username and password. This is especially useful, if you're using SharePoint for public-facing website. I wish it was easier to configure though. Here are a few "gotchas" that I have encountered trying to get ADFS working with SharePoint:

  • Extend your SharePoint web application to dedicate a separate section/URL for ADFS authentication
  • The configuration guides are very exact, in the sense that everything must be done exactly as it says in the guide. If you do not follow the instructions to the point or if you miss a step or two, ADFS authentication won't work and it will be nearly impossible to figure out what you did wrong. More often than not, it will be a lot easier to uninstall/reinstall ADFS and try again
  • Read your old notes on PKI and DNS, because configuring ADFS with SharePoint requires your PKI and DNS skills to be very sharp. Let's face it we tend to forget skills that we do not use on day to day basis
  • Use ADFS Diagnostics Tool, it is a very useful tool
  • Use ADFS Organizational Group Claims when assigning access permissions in SharePoint
  • To assign permissions to a specific user (instead of the assigning permissions through ADFS Organizational Group Claims), user must log in to the SharePoint first.

Good luck!

Building public-facing websites using SharePoint 2007: custom branding and development

This is a second part of the blog post on building public-facing websites using SharePoint 2007. The first part was dedicated to the planning building public-facing websites using SharePoint 2007.

Start with the minimal master page

Create a new blank master page using SharePoint Designer. I do not recommend basing your first custom master page on existing master pages templates, as those usually have a lot of SharePointy fluff that you do not necessarily want on your page. Start from scratch and only add the stuff you want/nee into your master page. Remember you can always come back to that master page and add more stuff in it later, if needed. Here is an excellent guide from Microsoft on how to how to create a minimal master page.

Building content types and page layouts

Building content types and page layouts is done in the following order:

When creating page layouts, try keeping the number of created page layouts to a minimum. Remember that page layouts are to be used only to define common "layouts" of your site, and you do not need a separate page layout for every single page on your site. Keeping the number of page layouts to a bare minimum will not only keep the size of your content database(s) to a minimum, but it will also you're your site a lot easier to manage.

Custom XSLT

A lot of the stuff in SharePoint is customized using XSLT files. For example, pretty much everything in Custom Query Web Part can be customized in XSLT file. There is also built in XSLT files that allows you to customize they some of the SharePoint content looks:

XSL Style Sheet

Purpose

Corresponding Web Part

ContentQueryMain.xsl

"Application" XSL style sheet

Content Query

Header.xsl

Group headers for Content Query and Summary Links, title headers for Table of Contents

Content Query, Summary Links, Table of Contents

ItemStyle.xsl

Content Query and Summary Link item styles

Content Query, Summary Links

LevelStyle.xsl

Table of Contents level styles, which includes the site and its pages

Table of Contents

SummaryLinkMain.xsl

"Application" XSL for Summary Links

Summary Links

TableOfContentsMain.xsl

"Application" XSL for Table of Contents

Table of Contents

Here is a guide on how to create custom item styles in SharePoint: http://msdn.microsoft.com/en-us/library/ms551040.aspx.

Source Control might save your…

It's always (and I mean always) a good idea to store your custom code in the Source Control such as Microsoft Team Foundation Server 2008. I strongly recommend that you store in the source control all your custom branding items: master pages, page layouts, CSS files, javascripts, images, configuration files, etc… Utilizing source control will not only allow you to keep a better track of the changes to your code, but it will also make it easier to integrate your custom code into the rest of your SharePoint deployment solution.

Use features to deploy

Features in SharePoint could be used to optimize the process of deployment and re-deployment of SharePoint master pages and page layouts. Here is couple of guides on how you can deploy master pages and page layouts as a feature: http://sharepointmagazine.net/technical/development/deploying-the-master-page and http://www.sharepointnutsandbolts.com/2007/04/deploying-master-pages-and-page-layouts.html.

Also, you can use features to deploy reusable content, such as stylesheets, images, javascript files, configuration files, and, of course, the static pages that will always appear on the site (contact us, careers, etc.). This way moving that content between servers (between staging and production servers, for example), can be done using a simple mouse click (or two) instead of manually re-creating that content every step of the way.

Naturally, there is a lot more to SharePoint custom branding to development, but those are the items that I remember off the top of my head. I will update the blog post if I remember anything else.

Meanwhile, the next topic of this blog post series is everything about SharePoint search functionality on public facing websites.



Related resources: