Showing posts with label WSS. Show all posts
Showing posts with label WSS. Show all posts

Wednesday, July 2, 2008

SharePoint publishing timer jobs woes

I hit a problem where the content management’s scheduling feature were not working. I am able to set the start and end publishing dates, but there’s no changes when the time comes to publish/unpublish the pages. Apparently this is due to missing timer job definition for the particular web application that is hosting the particular site collection.

The job does not exist in the first place because the web application were created without creating the publishing/collaboration site collection from the GUI. Instead, I’ve added the restored content DB that was build on another SharePoint box and added it directly into the web application. If I were to create a publishing/collaboration site collection, the site provisioning process would have added the missing three jobs for content scheduling, and two more jobs for handling variations.

Therefore, to get the jobs back on the web application, I have to:

1. Create a new web application

2. Create a new site collection, choosing the correct site collection template (either publishing or collaboration)

3. Ensure the jobs are created by checking it from Central Admin à Operations à Timer jobs definitions. Also check whether it runs every minute.

4. Remove the content db of the newly created site collection

5. Add the restored content db

Additional observations: If the existing web application with the restored content database already missing the job definitions, removing the content database and creating a new publishing/collaboration site collection on top of it WOULD NOT solve the problem. Strangely, the job definitions are created, but it just wouldn’t execute as defined by the minute frequency. Thus, best bet is to delete the web application and start all over again.

Janne Mattila’s blog has more detail on this issue.

Update: I tried to make the same steps as mentioned above on another enviornment, and it didn't work. I even tried to schedule a publishing start date for a new content page on the brand new blank collaboration site template, just to be sure. The page on the blank collaboration site works, but it just wouldn't work once I restore my deployment content DB. I've inspected the timer job status and discovered that the timer job last run date/time was stopped at the instance when I change the web application's content DB to the deployment content DB.

Long story short, I found MS KB942989 mentioning the problem of missing timer jobs, but not on timer job stop executing. However, it indicates that a post-SP1 hot fix could fix the problem. I've downloaded, applied to all WFE and index server, and that solves the problem magically!

More information on the hot fix at MS KB942989.

SharePoint Current Number of Sites 0 after SQL Restore of Content DB

I was planning to restore a content DB backup into a SharePoint box. So I’ve created the web application, removes the default content database and add the restored content DB into the web application. Once this is done, the value “Current Number of Sites” is showing up as 0.

Apparently, when adding a content DB into a web application, the SiteIDs (GUIDs) in the content DB are added into the [SharePoint_Config].[SiteMap] table. If a site with the same SiteID already exist in the SharePoint box, the add process will fail without much feedback from the Central Admin page. The logs from the 12 hive doesn’t give much indication either. The only clue you get is from the application event log. An inspection on the event log shows the following error:

Therefore, must take note that no two identical site can reside within the same SharePoint box. There might be possible to patch the SiteID for the restored content DB to another GUID value, provided you know where to patch J.

Wednesday, June 4, 2008

SharePoint security cache AD Group?

There seem to be a funny problem where AD group names are cached by SharePoint. So far I've observed two scenarios

Scenario 1: Unable to set AD group into MOSS security

I’ve created my own AD group and added the some users into the AD group. Then I add the AD group directly into some SharePoint subsite and granting them some permissions. This works out fine. Then I remove the AD group from SharePoint , delete the group from AD, and repeat the process again. I use back the exact same AD group name. This time, the user will not have access, as though the AD group is not added into SharePoint at all.

This problem can be fixed by performing an iisreset before re-adding the newly created AD group (with identical name as the previously deleted one) back into SharePoint. I’ll be performing “iisreset”s in the future when I’m setting up user permissions.

Scenario 2: People picker does not have the AD group

The scenario is like this: from a web part properties page, under Advnaced section, click on the browse button to bring up the people picker. Switch to find under Distribution/Security groups and perform a search. The AD groups that suppose to be around are not.

To fix this problem, just perform a full user profile import from the Shared Service Provider administration. But, there's a catch: you MUST delete all existing user profile, by viewing all existing user profile, and select all to perform the delete. Yes, painful process as there's no option to delete all existing user profile data, and it didn't work if you just perform a full user profile import directly.

Update: I've written a small console application to quickly delete all user profiles:

/*Include the following namespaces*/ using Microsoft.SharePoint; using Microsoft.SharePoint.Administration; using Microsoft.Office.Server.UserProfiles; using Microsoft.Office.Server; /*Here's the quick and dirty method*/ public void PurgeUserProfile(string url_) { using (SPSite site = new SPSite(url_)) { ServerContext context = ServerContext.GetContext(site); UserProfileManager profileManager = new UserProfileManager(context); foreach (UserProfile profile in profileManager) { System.Console.WriteLine("Deleting " + (String)profile[PropertyConstants.AccountName].Value); profileManager.RemoveUserProfile(profile.ID); } } }

Friday, May 23, 2008

SharePoint Tool Pane, where are you?

A colleague of mine are creating a new master page for an ECM site. Once all SharePoint controls were included into the new master page, we found that the tool pane (the one that shows web part properties) went off the grid, not restricted by the boundary of HTML tables etc.

After some research, it is concluded that the mater page need to include a PlaceHolder tag with an ID of “MSO_ContentDiv”. Followed by the PlaceHolder is a HTML table tag with an id of “MSO_ContentTable”. Both of these tags can be found in OOB SharePoint master pages. Once these two tags are in place, the tool pane attaches itself to the left side of this HTML table when it is summoned.

Thursday, May 15, 2008

Extending SharePoint Page Layout

Found this blog entry from Janne Mattila's regarding extending page layout to include your own funky stuff. The example given are for custom language change, dynamic master page change and dynamic page layout swapping. For my case, I needed to do this to capture statistics of page hits for specific pages. Refer to here for more details.