Friday, January 9, 2009

What are valid values for tp_servertemplate and what do they map to?

SharePoint has a MS SQL Server backend where it stores all its data. The data is stored in the Content database. In Windows SharePoint Services 2.0 (WSS2) and SharePoint Portal Server 2003 (SPS) the content database typically ends in _SITE. In Windows SharePoint Services 3.0 (WSS3) and Microsoft SharePoint Server 2007 (MOSS) the database is typically called something like _Content. For example WSS_Content.

All lists use the LISTS table. The sp_servertemplate column can be used to find all lists of a particular type, etc. The list varies a little bit between versions of SharePoint. For instance there are new values for blog and wiki in MOSS and WSS3, but they do not exist in WSS2 and SPS. As far as I know the newer version of SharePoint simply add more values, they don't change existing ones.

The question quickly becomes, "What are valid values for tp_servertemplate and what do they map to?" Below you will find such a list of possible values and what they map to in a user friendly and human readable format.

This text is essentially the text from the Microsoft Windows SharePoint Services 3.0 SDK or the actual docs

Optional Integer. Provides a unique identifier for the list definition. This identifier must be unique within the feature, but need not be unique across all feature definitions or site definitions. Windows SharePoint Services 3.0 includes the following list types by default.

  • 100 Generic list

  • 101 Document library

  • 102 Survey

  • 103 Links list

  • 104 Announcements list

  • 105 Contacts list

  • 106 Events list

  • 107 Tasks list

  • 108 Discussion board

  • 109 Picture library

  • 110 Data sources

  • 111 Site template gallery

  • 112 User Information list

  • 113 Web Part gallery

  • 114 List template gallery

  • 115 XML Form library

  • 116 Master pages gallery

  • 117 No-Code Workflows

  • 118 Custom Workflow Process

  • 119 Wiki Page library

  • 120 Custom grid for a list

  • 130 Data Connection library

  • 140 Workflow History

  • 150 Gantt Tasks list

  • 200 Meeting Series list

  • 201 Meeting Agenda list

  • 202 Meeting Attendees list

  • 204 Meeting Decisions list

  • 207 Meeting Objectives list

  • 210 Meeting text box

  • 211 Meeting Things To Bring list

  • 212 Meeting Workspace Pages list

  • 301 Blog Posts list

  • 302 Blog Comments list

  • 303 Blog Categories list

  • 1100 Issue tracking

  • 1200 Administrator tasks list

For custom list templates this attribute should be set to a number above 10000 to ensure that it does not conflict with any present or future Microsoft supplied list types.

Now you can do a SQL CASE statement in your select statement to give meaningful type descriptions instead of number. For example:

select case tp_servertemplate when 100 then 'Generic list' when 101 then 'Document library' when 102 then 'Survey' when 103 then 'Links list' when 104 then 'Announcements list' when 105 then 'Contacts list' when 106 then 'Events list' when 107 then 'Tasks list' when 108 then 'Discussion board' when 109 then 'Picture library' when 110 then 'Data sources' when 111 then 'Site template gallery' when 112 then 'User Information list' when 113 then 'Web Part gallery' when 114 then 'List template gallery' when 115 then 'XML Form library' when 116 then 'Master pages gallery' when 117 then 'No-Code Workflows' when 118 then 'Custom Workflow Process' when 119 then 'Wiki Page library' when 120 then 'Custom grid for a list' when 130 then 'Data Connection library' when 140 then 'Workflow History' when 150 then 'Gantt Tasks list' when 200 then 'Meeting Series list' when 201 then 'Meeting Agenda list' when 202 then 'Meeting Attendees list' when 204 then 'Meeting Decisions list' when 207 then 'Meeting Objectives list' when 210 then 'Meeting text box' when 211 then 'Meeting Things To Bring list' when 212 then 'Meeting Workspace Pages list' when 301 then 'Blog Posts list' when 302 then 'Blog Comments list' when 303 then 'Blog Categories list' when 1100 then 'Issue tracking' when 1200 then 'Administrator tasks list' else 'Other' end 'ListType' from lists

Tuesday, January 6, 2009

What is the Group Policy?

What is a Group Policy Group Policy for Active Directory is used to control settings on many computers using once central location for all the settings. The settings are pushed out to the many computers at some interval or an event such as rebooting a computer. The changes (in most cases) are stored applied to the many computers by changing values in the registries of the many computers. This makes it possible to temporarily change group policies settings until the next application of the Group Policy settings. How do I see what Group Policies are being applied to my computer? You can open a command prompt and use the gpresult command. It is very simple to use and takes a couple of minutes to run. To run it just type gpresult at the command prompt and wait a couple minutes. Soon you will see some very useful information including what location your user account and your computer are in the Active Directory. Where in the heck is the Group Policy Editor? Well, it is hidden from you, just like the Registry Editor (regedit.exe) since it can mess up your computer if you don't know what you are doing. To open the Group Policy Editor all you have to do is go to the Start menu | Run... and then type gpedit.msc and click the OK button. You can also use the Group Policy Snap-in for the Management Console. Check out this article on how to do so. http://support.microsoft.com/kb/307882. Are there any other tools I should know about? I think a freely available snap-in for the Management Console from Microsoft called Group Policy Management Console with Service Pack 1. It can be downloaded from here. You add it very much the same as you do the Group Policy Snap-in described above. When you add it, look for Group Policy Management. How do I force my computer to get the latest Group Policy? Open a command prompt and type GPUPDATE /force

SharePoint Incoming E-mail Overview

Overview: You can integrate incoming e-mail capability into your sites. This new feature enables teams to aggregate e-mail messages within lists and libraries without the extra step of opening the site and uploading the content that was sent in e-mail. This is possible because most list and library types can be assigned a unique e-mail address. Site members can add the e-mail addresses of these lists in the To or Cc box of their e-mail client application when they send e-mail, or they can send e-mail to a distribution list that contains the e-mail addresses of these lists as well as the e-mail addresses of other site members. You can enable and configure e-mail support for the following types of lists and libraries in your sites: document libraries, picture libraries, form libraries, announcements lists, calendar lists, blogs, and discussion boards. Anyone with permissions to create a list can choose an e-mail address for the list when creating the list in an e-mail-enabled site. Note that you cannot add content to lists in Meeting Workspace sites by sending e-mail. For more information, please see here Technical Impact:
  • E-mail addresses will be able to be created by End Users
  • A new OU will need to be created. Call it SharePoint if you like.
  • Active Directory users will be able to be created by End Users. Though only in the SharePoint OU.
  • No use of a system admin should be needed once this is setup
  • A new MX record (Mail record) will need to be added to DNS
  • A SMTP Send Connector will need to be added to MS Exchange to route e-mails
  • New e-mail accounts for each "list". It will be automatically managed by SharePoint
Technical Requirements:
  • Functional Active Directory Account:
  • Create a new OU (Organizational Unit) in the Active Directory. For example, SharePoint
  • Delegate control of the newly created OU to the Functional account. Permissions should be Read, Write, Create All Child Object.
  • Add MX record to DNS server that points to our SharePoint server. For example, sharepoint.mycompany.com. This is required so that we can resolve the e-mail domain name to the SharePoint server once an e-mail is received by the company mail server.
  • SMTP Relay (A SMTP Relay can accept incoming and outgoing SMTP messages and forward them to their appropriate location. Basically an SMTP router.) This MUST be installed on the SharePoint server.
  • Configured SMTP connector within MS Exchange e-mail server that knows where to send e-mails we designate for SharePoint.

Cannot open this item. You cannot use SharePoint. Your system administrator has turned off the feature.

So you are using Windows SharePoint Services 3.0 (WSS) or Microsoft Office SharePoint Server 2007 (MOSS) and you get the following message:

Cannot open this item. You cannot use SharePoint. Your system administrator has turned off the feature.

Before I get to how to fix it, here are some of the ways you may encounter this message:

  • Any Task list | Actions toolbar item | Connect to Outlook
  • Receive an alert (from task, list, calendar, file, etc) in Outlook and try to open it.

What does this message mean, you ask? First, let me say that it doesn't necessary mean that your administrator has turned off the feature. For example, if you are trying to open an alert / notification sent from SharePoint notifying you that a list, task, file, etc has changed and you get this message it could be a bug with Exchange. Here is the link that describes the issue.

http://support.microsoft.com/default.aspx/kb/930807/en-us

On the other hand, it could very well be exactly what the message says. To tell if this functionality truly been disabled by your administrator as the message indicates, the easiest thing is to check the registry.

To check the registry, do the following:

  1. Start menu | Run... | regedit.exe
  2. Navigate to HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Options\WSS\Disable
  3. If the value for Disabled is 1 then the feature is indeed disabled by your administrator. If the value is 0 then it is not disabled and I would consider it to be a bug. If you don't have 12.0 in the path above then you likely don't have Outlook 2007 and are using another version of Outlook. In that case check out the following blog

    http://blogs.technet.com/josebda/archive/2007/01/27/enabling-and-disabling-sharepoint-integration-in-outlook-2007.aspx.

    Though from what I can tell the path for Outlook 2007 is incorrect. You can always try what I specified above and the one that is noted in that blog.

You can directly edit the registry and this will work for a while. Please note, you will likely need to restart Outlook 2007 for the change to take affect. The problem is that if you are in a larger organization or one that uses Group Policies to manage such things your changes will be overwritten the next time the Group Policies are applied to your computer. You may need to contact your adminstrator to determine why they disabled this functionality in the first place and ask if they can change the policy. Good luck ;)

Friday, December 19, 2008

Why can't I see my Visual Studio 2008 Solution File in the Solution Explorer

In Visual Studio 2008 when you open your project or even open a solution file the Solution Explorer doesn't show the solution file by default. There are times that you want to see the solution file, like when you want to add multiple projects to a solution. To show the solution file in the Solution Explorer just follow the instructions below once you are have your project open in Visual Studio 2008.
  1. Go to the Tools Menu and choose the Options... menu item.
  2. In the Options window, expand the Projects and Solutions node.
  3. Click the General node (child of the Projects and Solutions node)
  4. Click the Always show solution checkbox.
  5. Click OK.
Now you should be able to see the Solution file in the Solution Explorer. If you want to add another project to the solution all you have to do is right click on the solution and choose Add | New Project...

Wednesday, December 17, 2008

Excel spreadsheet is Read-Only after opening from SharePoint

Here is the situation, I am using MOSS 2007, and a particular user or group of users was able to checkout, open an excel file from a SharePoint document library, make changes, save, and check in before some magical event and then they no longer have this ability. Now when user does this now, the user can check out the file, but when Excel opens the file, it is read only and cannot save file to SharePoint space either. The user can clearly see that when the file opens up the Excel title bar says that it is in Read Only mode, so it is very easy to see if this fixed it or not. Be sure to check it out first, otherwise it will be in read only mode. Especially if someone else has it checked out. There are a lot of suggestions out there on how to deal with this issue. There are even more complaining how different solutions didn't work. This solution works for me. Almost all of the solutions stem from issues with Microsoft Office SharePoint Services Support (which I believe is part of the Microsoft Office Access Web Datasheet Component) being installed incorrectly. The most important file appears to be OWSSUPP.DLL. By default it lives at C:\Program Files\Microsoft Office\Office12\OWSSUPP.DLL This is the DLL that should be used with MOSS and WSS. The problem that I have seen is that when the user experiences the issue described above, it is not using the correct version of this DLL. As it turns out there are other version of this DLL. In a perfect world, you would only have one version on your computer. The problem comes when you have different versions of Office products. An example would be that you have MS Excel 2007, but you are using an older version of MS Project, or MS Word 97, etc. In this type of installation there will likely be more than one copy of the OWSSUPP.DLL. I would search your Program Files directory for all instances of it. Generally, depending on your installation, you may find that they are located at: C:\Program Files\Microsoft Office\Office11\OWSSUPP.DLL C:\Program Files\Microsoft Office\Office10\OWSSUPP.DLL One solution people have recommended is reinstalling the Microsoft Office SharePoint Services Support using Add/Remove Programs. You have to click the Change button, and this should launch the MS Office installer. There you should be able to reinstall the component. With this method, I would imagine you will need to reinstall products in the order they were released so that the Office 2007 installation is last and will hopefully be found first. Another solution I personally tried was to just rename the non-Office12 instances of the file and try again. I recommend something like OWSSUPP_DISABLED.DLL so that it is clear that it has been renamed. I restarted IE, but I don't know if it was really necessary. I as happy I did NOT have to restart Windows though. This issue came up on Microsoft Office SharePoint Server 2007 (MOSS), but is most likely an issue on Windows SharePoint Services 3.0 (WSS). A side note, based on what I read on forums, the problem is on particular computers (which makes sense based on what this solution). Anyone who logs into this computer will likely have the same issue. If the user that is having the issue logs into another computer they will not have the issue while they are on that other computer (assuming it does not suffer from the same issue).

Wednesday, November 19, 2008

Which w3wp.exe is the one I want?

If you have every tried to debug a web application running on Windows Server 2003 you will be faced with which w3wp.exe process do you attach to remotely. I have figured out a few ways. In order of ease:
  1. User Name - If you change the App Pool Identity to something other than Network Service (like your personal user account... temporarily of course) you should be able to open Windows Task Manager and see name next to one of the w3wp.exe process. I highly recommend stopping and restarting the Application Pool (not just recycle it). The best part is you can also see the User Name in Visual Studio when are in the attach to process window and choosing the process.
  2. CPU Time - If you open Windows Task Manager, now recycle the App pool. The CPU Time should go to zero. When you hit a page on the site, it should show some small value greater than zero depending on how much cpu the page actually takes. This will allow you to get the PID (you may have to add the column to Windows Task Manager) which you can see when you are in Visual Studio and attaching to the process.
  3. You can also use Sysinternals (now Microsoft owns it so....) Process Explorer. Using this tool, you can right click on the w3wp.exe in its list of processes and look at the Command Line that was used to launch the process. The last parameter is the name of the App Pool. Assuming you are using different app pools for each web site, this will allow you to get the PID, and use that to attach to the process just like the other scenarios.
I hope this helps. I find it generally frustrating that it is so difficult to determine which process is the one I need. Oh well, this seems to work reasonably well.