Posts Tagged ‘Tips’
Friday, December 7th, 2007



Many of you will have downloaded (or plan to download) the VPC image for Search Server 2008 Express and will be keen to get going with the Federated Searching that is the cool new things in MSS (see my other posts).

If you plan to use Shared Networking for Internet access from your VPC you will probably want to take a look at this post by the VPC guy who has an invaluable tip to ensure Windows 2003 does not start rejecting incoming packets :)

Just set your DNS in the VPC to 192.168.131.254.

Thursday, September 27th, 2007



Following a recent forum thread on the subject I thought it would be useful post something for all of the people who have recently moved to MOSS.

Quote for Joel Oleson:

Ever had users say, for some odd reason some times when I hit my SharePoint site it takes 30 seconds to load, then after a refresh it goes sub second, even clearing their cache the page is fast.  That’s because it’s not a user issue, its simply compiling, caching, etc… on the server after an IISReset or app pool reset or worker process cycle.

Warming Up SharePoint

There is an easy fix for this that effectively warms up your SharePoint by making calls to all of the common pages to ensure the compiling and caching are done before the users hit the box.

If your an admin you will be looking for a batch script that you can run on your productions servers.   Joel has one here along with a good description of what is happening to make it slow.

If your a developer and/or you like things with GUI’s the Spencer Harbar’s neat little App Pool Recycle utility is a must,  something I install as a matter of course on my Development and Presentation VMs.

Sunday, September 2nd, 2007



Finally I am able to build and test my 64bit MOSS deployments on a 32bit Laptop :)

32 Vista host running 64bit guest

This is solution was brought to you on by

 

Lenovo T61p – UK Spec (T7500, 4GB Ram)

Windows Vista Ultimate 32bit Host

VMWare Workstation 6 Ace Edition

Windows Server 2003 64bit Enterprise Edition

 

If you need any more specifics please post a comment and I will be only to happy to help.   The only downside is the Vista 32bit only recognizing 3GB,  the bios picks up 4GB so when the drivers become available and stable I will look at upgrading.

Intel Virtualization Technology needs to be enabled, it’s disabled by default.

Intel Virtualization Technology

Thursday, August 30th, 2007



I encountered a problem recently whilst trying to do a Database Migration for MySites.   Running PRESCAN I encountered to the usual problems with 

“Error: The following site has not been scanned. Id =…

a quick search led me to Bill Baers excellent summary on PRESCAN and also a new Microsoft KB article 937291 which gives some really good error/resolution information.

However this is not the focus of this post,  in order to resolve some of my problems it was recommended to remove the content database and then add it back via the Manage Content Databases option in Central Admin,  so I dutifully complied (having done this on numerous occasions) but to my horror when adding the database back I got the error

The database schema is too old to perform this operation in this SharePoint cluster.  Please upgrade the database and try again.

How could this be,  I had just removed it!   After some head scratching and and the inevitable google I found this A disaster recovery movie but didn’t want to take the same approach as touching the database directly is a big no-no.   One of the comments lead me to checking the SystemVersion number in the content database,  which gave 6.0.2.8117.   I added a new content database to check what version it was expecting,  6.0.2.8028.    Ah ha the database I was trying to add was newer than the one the server was expecting, hence the error.   Another google on the version number 6.0.2.8117 I found this article that pointed me to this Microsoft KB 924881 January Hot fix rollup (download here).

Running the hotfix allowed me to add the content database back and continue with my PRESCAN and migration :)

 Again the Internet and peoples willingness to share experiences and knowledge helped what could have been a showstopper in our current project,  thanks :)

Monday, August 27th, 2007



I have to hold my hands up to recently getting my AAM settings wrong..  thanks to fellow MVP Shane Young for pointing out my obvious errors.  

Alternative Access Mappings (AAM) provide a way to serve the same SharePoint content using more than one URL.   This is often the case when you are using ISA Server 2006 to reverse proxy the SharePoint web application to the Internet; for example

https://www.mysharepointsite.com is mapped via ISA server to the machine and port hosting the application  http://mymossfarm:1234

Within the AAM settings you need to ensure that SharePoint can map  the url http://mymossfarm:1234 to https://www.mysharepointsite.com so that all urls and links are correctly rendered for the end user.

Rather than provide you with details on how to do this I will  point you to what is the regarded as the definitive resource (now packaged up as a TechNet article).

http://technet2.microsoft.com/windowsserver/WSS/en/library/c8ccffce-5162-46af-a3ef-1d7914e8efee1033.mspx?mfr=true

It is also worth checking that the ISA configuration is consistent with those in SharePoint.

Errors that indicate AAM may not be setup correctly

SharePoint works when accessing it directly from the box, however when accessing through ISA you may see the following

  • Content Query Web Part cannot render the content
  • Unable to perform searches
  • Unable to add Web Parts

The server will record “Object not set to an instance of an object” errors.

Sunday, July 29th, 2007



Michael Watson posted a short blog on Database mirroring and log shipping.  Which is better? but this fails to highlight that SharePoint does not support the “;Failover Partner=PartnerServerName” and therefore does not offer the benefit of automatic failover.

The white paper  Using database mirroring with Windows SharePoint Services details the steps required to notify SharePoint of the change in server but this involves lots of horrible stsadm commands, deleting and adding content databases and restarting servers.  Not really what I would regard as suitable as you’re using mirroring to provide high availability right?

One simple solution to this,  and again it’s not automatic but I am sure some of you scripting guru’s could add this to a MoM alert, is to use a DNS name called something like SharePoint_SQL,  then when the servers fail over just update the IP address for this to the mirrored server and your done.

[Update] Blogs do keep you honest, and I didn’t mean to be negative…  Michael has posted a fantastic response and yes it is true that I don’t know many SharePoint admin’s that have rights to DNS.   I look forward to Michael’s planned comparison between SQL Aliasing, Load balancing, host files and WINS/DNS.  He also points me to the stsadm -o renameserver command which is relevant to people using WSS V3/MOSS.

Saturday, July 21st, 2007



This can be achieved using a feature or as part of the onet.xml file for a site definition.   I will use a feature as this is my preferred approach and it can also be reused across multiple sites.

1.  Create feature

Create a new directory under the 12 hive, and create two new files feature.xml and elementManifest.xml (you can copy from an existing feature to make this easier).  

Edit the feature file and add the contents as below,  this will be the basis of the feature.  You will need to provide a unique GUID.  Use guidgen from Visual Studio to generate you GUID.

<Feature  Title=”Add Picture Feature” Id=”21BC0000-805F-4151-A41C-5FE5B66ACBDA”
          Description=”Add Picture Demo” Version=”1.0.0.0″
          Scope=”Web” Hidden=”TRUE” DefaultResourceFile=”core”
          xmlns=”
http://schemas.microsoft.com/sharepoint/”>
  <ElementManifests>
    <ElementManifest Location=”elementManifest.xml” />
  </ElementManifests>
</Feature>

2. Create a subdirectory under the feature folder

When you upload an image to a picture library SharePoint creates two additional versions of that image in JPEG format that it displays in the thumbnail and preview screens.   When adding images we need to also add these and they will be renamed with a .jpg extension as shown:

MyPicture.gif  ->  MyPicture_gif.jpg

MyPicture.jpg -> MyPicture_jpg.jpg

Create a subdirectory below the feature called “Picture Library” and then create two folders beneath this call “t” and “w”.

Tip:  Upload the image to an existing library to generate the thumbnail and preview images.

This will give you a directory structure similar to this

Folders

Copy the original image to the “Picture Library” directory, and the thumbnail and preview images to the “t” and “w” sub directories respectively.

3. Add the files to the feature.xml and elementManifest.xml files

feature.xml

Add the images files to your feature.xml file as below.

<Feature  Title=”Add Picture Feature” Id=”21BC0000-805F-4151-A41C-5FE5B66ACBDA”
          Description=”Add Picture Demo” Version=”1.0.0.0″
          Scope=”Web” Hidden=”TRUE” DefaultResourceFile=”core”
          xmlns=”http://schemas.microsoft.com/sharepoint/”>
  <ElementManifests>
    <ElementManifest Location=”elementManifest.xml” />
    <ElementFile Location=”Picture Library\21appsLogo_large.jpg” />
    <ElementFile Location=”Picture Library\w\21appsLogo_large_jpg.jpg” />
    <ElementFile Location=”Picture Library\t\21appsLogo_large_jpg.jpg” />
  </ElementManifests>
</Feature> 

 

elementsManifest.xml

The elements manifest file defines the picture library we are creating and the  source and target for each of the files. 

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
    <ListInstance FeatureId=”00bfea71-52d4-45b3-b544-b1c71b620109″ TemplateType=”109″ Title=”Picture Library” Url=”Picture Library” />
    <Module Name=”PictureLibrary” List=”109″ Url=”Picture Library” Path=”Picture Library”>
    <File Url=”21appsLogo_large.jpg” Type=”GhostableInLibrary” />
  </Module>
  <Module Name=”PictureLibrary1″ List=”109″ Url=”Picture Library/_t” Path=”Picture Library\t”>
    <File Url=”21appsLogo_large_jpg.jpg” />
  </Module>
  <Module Name=”PictureLibrary2″ List=”109″ Url=”Picture Library/_w” Path=”Picture Library\w”>
    <File Url=”21appsLogo_large_jpg.jpg” />
  </Module>
  <Module Name=”Remainder” Url=”" Path=”">
  </Module>
</Elements>

Note: three modules are used as the URL (path) the files are copied from and to are different. 

The thumbnail and preview images are located in /_t and /_w folders within a picture library.

In this example we have also created the picture library in which we will add the picture

    <ListInstance FeatureId=”00bfea71-52d4-45b3-b544-b1c71b620109″ TemplateType=”109″ Title=”Picture Library” Url=”Picture Library” />

4. Install the feature

Using stsadm.exe install the feature

stsadm -o installfeature -name AddPictureFeature

In our example we have hidden the feature (Hidden=”True”) as we will add this directly to a sites onet.xml file so that it is created upfront.  This is often referred to as Feature Stapling.

5.  Update the site defintions onet.xml

In this example I will add the feature to the STS site definition, 

Warning – it is always recommended to make copies and change these as future service packs may overwrite your changes and you could effect you support.

Add the feature to the <WebFeatures> section of the sites onet.xml.  Depending on your site definition you may need to add this to multiple configurations.

<!– Add Picture Feature –>
<Feature ID=”00bfea71-52d4-45b3-b544-b1c71b620109″ />

6.  Recycle and Create the site

Do an IISreset (as your doing this in dev, aren’t you!) and create a new Team Site (or the site you altered).

7. Create a site test

After creating the site you should now see a Picture Library with one image automatically included.

picturelib

Clicking on the library should show your image with the thumbnail.

Thumbnail

Hope this is of some help,  it’s fairly basic stuff but sometimes these simple things are easily forgotten.

Thursday, July 12th, 2007



This posting is a bit of a note to self, apologies if you’ve seen this before (and you probably should have as Official SharePoint blog should be on your feed list!).

This post shows how the SharePoint design team have used Javascript to default the selected value in a drop down list based on a value passed in the query string.  The bit that I was most interested in, and have seen little mention of anywhere else – or at least when I first looked, was the _spBodyOnLoadFunctionNames array.

 _spBodyOnLoadFunctionNames

In most cases SharePoint pages are based on a master page that contains the “body” element. These content pages can’t directly add a function to the body’s onload event. In order to work around this limitation, SharePoint provides the “_spBodyOnLoadFunctionNames” array. When the body is loaded, the onload event handler executes each function whose name is contained in this array.   So you can add any functions and push them into the onload event, cool.

_spBodyOnLoadFunctionNames.push(”MyJavascriptFunction”);

Saturday, July 7th, 2007



Andrew Bridgeman recently emailed me about an issue he had encountered with his internal MOSS 2007 deployment.    He had implemented the out of the box maintenance plans using the wizards and initially all was well with the world.  He only realised there may be a problem when the portal became unresponsive,and on investigation this was down to SQL Server running at 100% CPU and the crawler stuck on “crawling full”.

Other people have had this or similar problems and Mike Hanley found a solution to this here.

The good news is that this has been resolved with SQL 2005 SP2  – as detailed in the Microsoft KB article http://support.microsoft.com/kb/930887

The other benefit to using SP2 is the improved integration with Reporting Services as detailed by Lawrence

Monday, June 25th, 2007



Dave Wollerman has posted a great article on the use of site collections and the benefits they have for users and administrators.

Quoting Dave:

Recycle Bins

I have 2 big, at least what I think is big, points on why to use site collections. The first one is site quotas and recycle bins. The issue is the recycle bin is based on site collections and the quota for a site collection. If everyone shares a site collection, then they share the recycle bins storage size.

Delegated Security

The second point is distributed administration. For most small companies this might be a moot point, but for high content driven organizations with a small IT force. It is a godsend for IT. IT doesn’t know who should be able to see what content, besides how it should be organized. This is the job of the content owners and users. SharePoint site collections offers IT the ability to create a site collection for a project, team, department, document, or whatever the needs are, then assign an owner and hand it off to them.

In addition to these two points is the need to separate the content between databases.  The number of large installations I have seen that have lumped all of the content (and we’re sometimes talking portal and sites) into the same content db just shows that this knowledge is not being shared.   Well done Dave for posting this!