Posted by (JavaScript must be enabled to view this email address) on Wed 11 Mar 2009
After installing Office 2007 Project Server on our MOSS 2007 box we were unable to provision the project access website as it was failing with the error message:
“The Project Application Service doesn’t exist or is stopped. Start the Project Application Service.”
To resolve it we had to first of all:
stsadm -o provisionservice -action start -servicetype “Microsoft.Office.Project.Server.Administration.ProjectApplicationService, Microsoft.Office.Project.Server.Administration, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C” -servicename ProjectApplicationService
Then provide the MOSS SSP Account with temporary administrative access to the DB server to allow it to generate the required dbs.
Posted by (JavaScript must be enabled to view this email address) on Mon 09 Mar 2009
Occasionally you will find that your user account doesn’t have a default database associated with it, this will stop you logging into SQL using Windows Authentication regardless of being a local administrator.
To be able to log in do the following:
1. Create a local user (as you have administrative access this is fine)
2. Add the user to local administrators and to the SQL Server Users group something like this (SQLServer2005MSSQLUser$MACHINENAME$INSTANCENAME)
3. Restart the SQL Server
4. Log into the laptop as the new local user
5. Run SQL Server
6. Go to security and right click on the user account which does not have access to SQL Server and select properties
7. Set the default database as master
8. Set the user role as required
9. Ensure that the user has access to the correct databases
10. Click ok
11. Log out of the pc
12. Log in as the original user.
You will now have access to log into the SQL Server.
Posted by (JavaScript must be enabled to view this email address) on Thu 29 Jan 2009
I’d recently written a SharePoint custom navigation object as the default functionality didn’t meet the customers needs. It tested out perfectly, only displaying pages which the user was able to see and which were also published.
When deployed on the live server though, no matter what I did, it simply wasn’t picking up the fact that some pages had been published, others had expired. It was displaying all content (apart from the hidden pages) in the publishing site.
What was going on
For too long I focused on the way the dates were being handled by my control…but surely the PortalSiteNavigation provider should take care of this?!?!?? I even went so far as to load the corresponding page item for each SiteMapNode in the SiteMapNodes collection then checking the PublishingStartDate and PublishingExpirationDate (Scheduled Start Date and Scheduled End Date) - Imagine the hit on performance when I did that!
After a lot of hair ripping, and swearing I found the issue.
Stsadm extensions had been installed on the server- I had used them a number of times to publish content en-masse for the customer - but it never twigged with me that this might be the root cause of all my issues.
A normally super helpful command gl-publishitems was the culprit. Gary Lapointes code has helped me out a number of times, this is by no means a slight against his code - just an unforeseen issue arising from it.
Each time the gl-publishitems code was run against the WebApplication it was republishing the “expired” content. SharePoint doesn’t actually use the dates at runtime to decide whether content should be displayed or hidden, it uses the dates as part of the Scheduled Unpublish and Scheduled Publish timer jobs to set the publishing status to published or draft.
The second issue was that not only was gl-publishitems republishing my content, but when the ScheduledUnpublish job would run, it would unpublish the content, however there were previous versions available in the system - and again SharePoint only rolls back the current version not all versions when the Scheduled Unpublish job runs.
So how did I resolve it?
By programmatically getting all versions of the “expired” document and setting them to Draft status using the File.Unpublish Command
I’ve included code samples in both C# and VB.Net here:
VB.Net
if (Convert.ToDateTime(Actual) < DateTime.Now) then rWeb.AllowUnsafeUpdates = true lItem.ModerationInformation.Status = SPModerationStatusType.Draft ' set the item to draft 'for each previous version of the file Dim objVersionColl As SPListItemVersionCollection = lItem.Versions If objVersionColl.Count > 1 Then Previous = "resetting previous versions" 'Navigate to each version of the ListItem For Each objVersion As SPListItemVersion In objVersionColl Dim objLstItm As SPListItem = objVersion.ListItem objLstItm.ModerationInformation.Status = SPModerationStatusType.Draft ' set the item to draft objLstItm.SystemUpdate(false) 'updates the list item without incrementing the version Next 'Next objVersion End If 'End of objVersionColl.Count if lItem.SystemUpdate(false) end if
C#
if ((Convert.ToDateTime(Actual) < DateTime.Now)) { rWeb.AllowUnsafeUpdates = true; lItem.ModerationInformation.Status = SPModerationStatusType.Draft; // set the item to draft lItem.File.UnPublish("System Unpublished"); //unpublish the file //for each previous version of the file SPListItemVersionCollection objVersionColl = lItem.Versions; if (objVersionColl.Count > 1) { Previous = "resetting previous versions"; //Navigate to each version of the ListItem foreach (SPListItemVersion objVersion in objVersionColl) { SPListItem objLstItm = objVersion.ListItem; objLstItm.ModerationInformation.Status = SPModerationStatusType.Draft; // set the item to draft objLstItm.File.UnPublish("System Unpublished"); //unpublish the file with comment objLstItm.SystemUpdate(false); //updates the list item without incrementing the version } //Next objVersion } //End of objVersionColl.Count if lItem.SystemUpdate(false); }
A word of warning
The code I posted here does not differentiate between major and minor versions. You can only UnPublish Major versions so you will need to handle that yourself.
I used SystemUpdate(false) instead of Update as it doesn’t increment the version count - I would recommend you use File.Update instead.
REMEMBER - ALWAYS TAKE A BACKUP!