Wednesday, 6 April 2011
Decrypting error in multi-forest environment
Tuesday, 22 February 2011
Update-SPProfilePhotoStore and Service Application permission
This command requires Full Control on the "User Profile Application" service application (Use the Permissions tab on the Manage Servcie Applications page).
Sunday, 9 January 2011
Solving ‘Configuring certificate’ hang for User Profile Synchronization Service.
The quick explanation:
1. If you re-provision the UPA service and encounter an error while creating the certificate, check this blog post by Paul Culmsee: More User Profile Sync issues in SP2010: Certificate Provisioning Fun.
2. If you delete the certificate in Trusted Root Certification Authorities and still are stuck on ‘Starting’ you also need to delete the certificate “higher up” in the certificate chain at Personal –> “ForefrontIdentityManager”.
A few good pointers:
Start to put the User Profile ULS category to Verbose, then read this blogpost by the SharePoint Escalation Team. Compare the ULS log entries you got with the blogpost, it´ll show where in the process the provisioning fails.
To unprovision the service run the powershell command: Stop-SPServiceInstance –Identity ‘'GUID’
Get the GUID by “Get-SPServiceInstance”, if you have more than one SP server in the farm you have two instances of the service name ‘User Profile Synchronization’, the one which is active has the status “Provisioning”. You might also need to delete the “UserProfileSyncronizationSetup” job before the unprovisioning can start.
In my case I could disregard these error messages in the ULS logs:
ILMPostSetupConfiguration: ILM Configuration: Validating installation of SQL Service. ILM Configuration: Error 'ERR_SERVICE_NOT_INSTALLED' ILMPostSetupConfiguration: ILM Configuration: Validating installation of SQL Service FAILED
Update: Another case required the removal of all subfolders in the MaData folder. I had alot of errrors regarding MS DTC before the removal
Thursday, 9 December 2010
Error message when adding a new column:
Culture ID 1164 (0x048C) is not a supported culture.
Parameter name: culture
The file "Microsoft.SharePoint.ApplicationPages.dll" has not been updated in the app_bin folders for each virtual server.
1. Stop the IIS service.
2. Copy the file from 12Hive\Config\Bin to all app_bin which have SP installed
3. The version of the file "Microsoft.SharePoint.ApplicationPages.dll" should be "12.0.6548.5000"
4. Start the IIS service again.
Friday, 3 December 2010
Downgrade of Enterprise to Standard editon for Sharepoint 2010
If you don´t restore the master database, you need to run "GRANT VIEW SERVER STATE TO [MyDomain\FarmAccount]" to avoid flooding of "Event 5586" with error message "
The user does not have permission to perform this action."
One thing that is not to obvioulsy is that the "Property Store" and "Web Analytics Service Reporting" database uses Enterprise functionality and can not be attached to a Standard edition.
You need to recreate the Service Applications for the Search Service and Web Analytics. So plan for it beforehand.
The Search Service can not be deleted i the UI, check this how to use stsadm to delete it. You also need to delete the Search DBs in the same way or else the Event viewer will be filled with connection errors for the orphan databases.
Wednesday, 10 November 2010
Code example for EnabledScript element in Ribbon XML
Andrew Connel explains how to enable and disable buttons in the Ribbon based on a condition.
I need to check a field value on the selected item and the item permission and then enable / disable multiple buttons. I assume that you have some knowledge about the Ribbon XML structure :).
//Should only be enabled when IssueStatus == Report
<CommandUIHandler
Command="Tab.CloseIssue"
CommandAction="javascript:EditDeviation('{ListId}');"
EnabledScript="javascript:SingleEnable('Report',SP.PermissionKind.editListItems);"/>
//Should always be enabled
<CommandUIHandler
Command="Tab.CurrentStatus"
CommandAction="javascript:DisplayStatus('{ListId}');"
EnabledScript="javascript:SingleEnable('All',,SP.PermissionKind.viewListItems);"/>
function SingleEnable(EnableForStatus, PermissionKind) {
var result = false;
var selectedItems = SP.ListOperation.Selection.getSelectedItems();
var ci2 = CountDictionary(selectedItems);
if (ci2 == 1) {
if (this.IssueRibbonItemId == null) {
this.IssueRibbonItemId = selectedItems[0]['id'];
var listGuid = SP.ListOperation.Selection.getSelectedList();
getStatus(this.IssueRibbonItemId, listGuid);
}
else if (this.IssueRibbonItemId != selectedItems[0]['id']) {
this.IssueRibbonItemId = selectedItems[0]['id'];
var listGuid = SP.ListOperation.Selection.getSelectedList();
getStatus(this.IssueRibbonItemId, listGuid);
}
else if(this.IssueRibbonStatus != null){
if (this.IssueRibbonStatus == EnableForStatus || EnableForStatus == '') {
if(this.IssueItem.get_effectiveBasePermissions().has(PermissionKind)){
result = true;
}
}
}
}
return result;
}
function getStatus(ItemId, listGuid) {
var clientContext = new SP.ClientContext();
var web = clientContext.get_web();
var lists = web.get_lists();
var list = lists.getById(listGuid);
this.IssueItem = list.getItemById(ItemId);
clientContext.load(IssueItem, 'IssueStatus', 'EffectiveBasePermissions');
clientContext.executeQueryAsync(Function.createDelegate(this, this.onStatusQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
function onStatusQuerySucceeded(sender, args) {
this.IssueRibbonStatus = this.IssueItem.get_item("IssueStatus");
RefreshCommandUI(); //Makes the EnabledScrip method to be enabled again.
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
Monday, 1 November 2010
Some TaxonomyField things and code
Several suggestions how to add a new term with code has been posted and this is my conclusion:
Adding a new term to an item:
TaxonomyField tf = item.Fields["ColumnName"] as TaxonomyField;
tf.SetFieldValue(item,term);
item.Update();
This doesn´t work for new items:
int hiddenTermId = -1;
int[] wssIds = TaxonomyField.GetWssIdsOfTerm(site, TermStore.Id, TermSet.Id, Term.Id, false, 1);
if(wssIds.Length > 0)
hiddenTermId = wssIds[0];
TaxonomyFieldValue tfv = new TaxonomyFieldValue(termId + ";#" + term.Name + TaxonomyField.TaxonomyGuidLabelDelimiter + term.Id.ToString())
or this:
string termString = String.Concat("-1", SPFieldMultiColumnValue.Delimiter, term.GetDefaultLabel(1033));
TaxonomyFieldValue tfv = new TaxonomyFieldValue(termString);
Add a comment if you have any question.
Friday, 27 August 2010
MissingSetupFile for themes
Start SPD and open the site. Browse to the themes folder and delete the theme folder referenced in "MissingSetupFiles". Open the web in the browser and delete the folder from the Recycle Bin and then also from the site collection Recycle Bin.
Tuesday, 6 July 2010
Unexpected error creating debug information file
Sometimes I have had big problems when recompiling the SP projects and generating the PDB file. This time I disabled the VSHOST option for my WinForm project and the problem was solved.
VS spawns a new winformexe.vshost.exe process each time I tried to kill it with Process Explorer, so it kept me from recompiling the other SP corrctly.
How to: Disable the Hosting Process
Monday, 10 May 2010
WSPBuilder and VB.Net
A known fix for getting all ASP.Net items available in a WSPBuilder project is to amend the .csproj file with a ProjectTypeGuids element. The same goes for VB.Net but the element that needs to be added is different:
Wednesday, 28 April 2010
WebTemplate
Monday, 26 April 2010
MCPD!
Wednesday, 21 April 2010
jQuery and the find selector
Solution reference: http://www.gammageek.com/2008/10/jquery-xml-in-ie.html
Wednesday, 24 February 2010
Enable debugging for _layouts files
<configuration>
<sharepoint>
<safemode maxcontrols="200" callstack="true" directfiledependencies="10" totalfiledependencies="50" allowpageleveltrace="false">
<pageparserpaths>
</pageparserpaths>
</safemode>
</sharepoint>
<system.web>
<compilation batch="false" batchtimeout="600" maxbatchsize="10000" maxbatchgeneratedfilesize="10000">
<httphandlers>
<add type="System.Web.UI.PageHandlerFactory, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" path="*.aspx" verb="*">
</httphandlers>
<customerrors mode="Off">
</SYSTEM.WEB>
</configuration>
Save the file and your ASP.Net error messages will appear.
Friday, 4 December 2009
Push changes from a content hub
2. Click on "Manage Publishing for this content type" in the content type administration page.
3.Click on "Publish" if it´s a new content type or "Republish" if it´s a content type update.
4. Fire up "SharePoint 2010 Management Shell" on the SharePoint server.
5. Run these commands to trigger the timer jobs for content hub sync:
Start-SPTimerJob MetadataHubTimerJob
Start-SPTimerJob MetadataSubscriberTimerJob
6. Check your "Job History" (Monitoring --> Check job status --> Job History) page in CA for the status of the timer jobs
Sunday, 29 November 2009
Updatelistitems and 0x8007000
The webservice call worked correctly for site collection admin and site admins but not for ordinary users. The list was configurd with "Add item" and "View pages" permissons for ordinary users which should provide correct access for the UpdateListItem method.
The problem with the list was that is was configured with a "None" value for the property "Edit access" (General settings --> Advanced settings). After changing it to "Only their own" the method call succeeded. So the "Edit items" property was messing up a "New item" method call.
Updatelistitems and 0x8007000
The webservice call worked correctly for site collection admin and site admins but not for ordinary users. The list was configurd with "Add item" and "View pages" permissons for ordinary users which should provide correct access for the UpdateListItem method.
Thursday, 26 November 2009
OT: Copy contacts between C905 and Satio
Friday, 20 November 2009
Move My Site web application in MOSS 2007
Use this guide to add a host header.
Make sure you use the Default zone (or else you can not browse to 'Advanced Permissions' or add web parts).
Update "My Site" settings in the SSP
Recrawl the content source which index the user profile database, or else you will not be able to search for users.
Fix Hyper-V VHD for Virtual Box 3.0.10
The solution was to download VPC 2007 and run the Disk Wizard and compact the VHD (as stated here).