Archive for SharePoint 2010

SharePoint 2013 Migration: User not able to access after migration from SharePoint 2010 to SharePoint 2013

Scenario:

We have migrated our sites from SharePoint 2010 to SharePoint 2013. After migration, users are not able to access newly migrated site. If we delete user and provide access again, user able to access site. (Fortunately, this was happening on test migration)

Resolution:

The missing link was warning that we overlooked. When we ran PowerShell Test-SPContentDatabase cmdlet, we missed following warning:

Category : Configuration

Error : False

UpgradeBlocking : False

Message : The [SharePoint2013] web application is configured with claims authentication mode however the content database you are trying to attach is intended to be used against a windows classic authentication mode.

Remedy : There is an inconsistency between the authentication mode of target web application and the source web application. Ensure that the authentication mode setting in upgraded web application is the same as what you had in previous SharePoint 2010 web application. Refer to the link http://go.microsoft.com/fwlink/?LinkId=236865 for more information.

Locations :

In other words, SharePoint 2013 discourage classic mode authentication. If web application is created via Central Administration, claim based is the default and preferred method of authentication. If want to create web application with classic mode authentication, you need to use PowerShell cmdlets.

It goes like this:

  1. Create classic mode web application using PowerShell cmdlets
  2. Attach all content database with web application
  3. Convert classis mode web application to claim base authentication
  4. Configure Object cache

Create classic mode web application using PowerShell cmdlets

$ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication –DisableKerberos

New-SPWebApplication -Name “SharePoint – 2013” -ApplicationPool “SharePoint 2013 Web Apps” -ApplicationPoolAccount (Get-SPManagedAccount “domain\login”) -Port 80 -Url http://sharepoint2013 -AuthenticationMethod NTLM -AuthenticationProvider $ap -DatabaseName “WSS_Content_01”

Attach all content database with web application

Mount-SPContentDatabase “WSS_Content_2” -DatabaseServer “SQLDB2013” -WebApplication http://sharepoint2013

Convert classis mode web application to claim base authentication

Convert-SPWebApplication –Identity http://sharepoint2013 –To Claims -RetainPermissions –Force

Configure Object cache

$wa = Get-SPWebApplication -Identity http://sharepoint2013

$wa.Properties[“portalsuperuseraccount”] = “domain\login”

$wa.Properties[“portalsuperreaderaccount”] = “domain\login”

$wa.Update()

Make sure you enter user login using SharePoint 2013 claims encoding. It must be in this format “i:0#.w|contoso\chris” [For details, please visit] and don’t forget to restart IIS.


Advertisements

Leave a Comment

Nintex Workflow: Remove / Delete Custom Actions

Scenario:

We have created a lot of custom actions and wanted to remove some custom actions that are created for POC purpose only.

Resolution:

For Nintex Workflow 2010,

  • Using windows powershell go to, “C:\Program Files\Nintex\Nintex Workflow 2010” or “C:\Program Files (x86)\Nintex\Nintex Workflow 2010”
  • Run NWAdmin.exe with switches -o RemoveAction -adapterType <namespace.class of adapter> | -id <id of action>
  • One way of finding ID of Custom Action is accessing Nintex database and looking into table “Activities”. In this table you will be able to find all details related to custom activities.

For Nintex Workflow 2013,

  • Path of NWAdmin.exe changes to “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\BIN”

Leave a Comment

SharePoint: Create Dynamic SPQuery

Scenario:

We need to develop a webpart that searches a list in SharePoint. The search criteria are based upon user input. A simplified image of search criteria is as under:


Resolution:

After googling, we found a great solution:
http://sharepointcamlhelper.codeplex.com/

Suppose we have two checkboxes and two radio button, then our query should be like this:

SPQuery oQuery = new SPQuery();
CAMLManager mgr = new CAMLManager();
mgr.QueryGroups.Add(new QueryGroup("ColumnName", Types.FieldTypes.Text, Types.QueryTypes.Eq, "ColumnValue"));
mgr.QueryGroups.Add(new QueryGroup(Types.JoinTypes.And, "ColumnName", Types.FieldTypes.Text, Types.QueryTypes.Eq, "ColumnValue"));
if (chkSelectGroup.Checked == true)
{
mgr.QueryGroups.Add(new QueryGroup(Types.JoinTypes.And, "ColumnName", Types.FieldTypes.Text, Types.QueryTypes.Eq, ddlSelectGroup.SelectedItem.Text));
}
if (chkSubject.Checked == true)
{
mgr.QueryGroups.Add(new QueryGroup(Types.JoinTypes.And, "ColumnName", Types.FieldTypes.Text, Types.QueryTypes.Contains, txtSubject.Text));
}
if (rbAnnByEmail.SelectedIndex != -1)
{
if (rbAnnByEmail.SelectedItem.Text == "Yes")
{
mgr.QueryGroups.Add(new QueryGroup(Types.JoinTypes.And, "ColumnName", Types.FieldTypes.Text, Types.QueryTypes.Eq, "ColumnValue"));
}
if (rbAnnByEmail.SelectedItem.Text == "No")
{
mgr.QueryGroups.Add(new QueryGroup(Types.JoinTypes.And, "ColumnName", Types.FieldTypes.Text, Types.QueryTypes.Eq, "ColumnValue"));
}
}
mgr.OrderBy.Add(new OrderBy("ColumnName", false));
string camlQuery = mgr.GetFullCAML();
oQuery.Query = camlQuery;

Issue:
One thing that doesn’t seems to be working is “ViewFields”. We have added following lines to restrict our query to specific fields, but it doesn’t seems to be working.

cmgr.ViewFields.Add(new ViewField("ColumnName"));
cmgr.ViewFields.Add(new ViewField("ColumnName"));
cmgr.ViewFields.Add(new ViewField("ColumnName"));
cmgr.ViewFields.Add(new ViewField("ColumnName"));
cmgr.ViewFields.Add(new ViewField("ColumnName"));


Update:
If we add following code, ViewFields seems to work

spQuery.ViewFieldsOnly = true;
spQuery.ViewFields = cmgr.GetViewFields().Replace("", "").Replace("", "");

Comments (1)

SharePoint 2010 Best Practices

Leave a Comment

Microsoft Security Bulletin – Vulnerabilities in SharePoint Could Allow Elevation of Privilege

Leave a Comment

SharePoint 2010: Change Ribbon Background Color

Ribbon background color can be change by adding following CSS:

#s4-ribbonrow

{
background-color:#0057A7 !important;
}

Where “s4-ribbonrow” is the ID of the div containing ribbon

Leave a Comment

MOSS 2007 / SharePoint 2010: Cumulative Updates

Windows SharePoint Services 3.0 cumulative update server hotfix package (WSS server-package): April 24, 2012 – http://support.microsoft.com/kb/2598130

SharePoint Server 2007 Cumulative Update Server Hotfix Package (MOSS server-package): April 24, 2012 – http://support.microsoft.com/kb/2598129

SharePoint Foundation 2010 cumulative update package (SharePoint Foundation server-package): April 24, 2012 – http://support.microsoft.com/kb/2598321

SharePoint Server 2010 cumulative update package (SharePoint server-package): April 24, 2012 – http://support.microsoft.com/kb/2598151

Comments (1)

Older Posts »