SharePoint 2013 Configuring User Licensing

We recently enabled User Licensing in our environment and I ran into some issues getting it to work properly.  With licensing enabled I was unable to access the protected functions even though I was a member of the proper groups.  I had ran into a similar issue in the past with MySites not provisioning properly when licensing enabled and had a case open with Microsoft.  The end result was they told us we needed to map the claim identity since we were using ADFS as our trusted claims provider.

I had put that on the back burner since we had decided to hold off on using MySites and it required learning a bit more about claims encoding.  Since the issue had come up again I decided to get to the bottom of it.

References

http://support.microsoft.com/kb/2886404

I had found this article talking about enabling licensing for claims, however, I was unable to get it working as described.

http://social.technet.microsoft.com/wiki/contents/articles/13921.sharepoint-2013-claims-encoding-also-valuable-for-sharepoint-2010.aspx

This article was excellent for learning the specifics of claims encoding and how I needed to build the claim for my uses.

Overview

SharePoint 2013 can be configured to allow specific users perform certain actions.  For example with Office Web Apps Server 2013 integrated with the SharePoint environment only certain users may be allowed to edit documents within OWA due to licensing constraints.  This can be achieved by enabling and configuring user licensing.

Enable User Licensing

The following command is used to enable licensing in the SharePoint farm.  Once licensing is enabled explicit license mappings must be created to allow users to use license protected actions.  Such as Office Web Apps editing and Enterprise features.

user-licensing-01

Assigning User Licenses to Security Groups

Once licensing is enabled, user mappings need to be executed.  These mappings represent which security groups are allowed to execute what actions.

There are four individual groups that licenses can be assigned.  These can be seen by using the Get-SPUserLicense cmd-let. For my use we will only be using Enterprise, Standard and OfficeWebAppsEdit in our environment since there is no Project Server installed:

user-licensing-02

NTLM

For a web application that is configured to use the default Windows claims provider the security group is simply passed to the New-SPUserLicenseMapping and Add-SPUserLicenseMapping cmd-lets.

$map = New-SPUserLicenseMapping –SecurityGroup “SPEnterpriseUser” –License Enterprise

$map | Add-SPUserLicenseMapping

To verify the license mapping has taken effect use the Get-SPUserLicenseMapping cmd-let:

user-licensing-03

Repeat this command for each Security Group and License required.  Creating a license mapping for the Standard features isn’t required, but adding it provides consistency.

Trusted Claims Provider

When using a Trusted Claims Provider such as ADFS the mapping becomes a bit more challenging.  You need to encode the claim before mapping the license.  This require a little bit of knowledge of the claims encoding format.  A good article to reference is located at:

 http://social.technet.microsoft.com/wiki/contents/articles/13921.sharepoint-2013-claims-encoding-also-valuable-for-sharepoint-2010.aspx

This article tells you what each part of the claims encoding means.  First we need to build a new claims string using the following reference:

<IdentityClaim>:0<ClaimType><ClaimValueType><AuthMode>|<OriginalIssuer (optional)>|<ClaimValue>

Referencing the above article I’ve constructed the following claim:

c:0-.t|ADFS20|SPOWAEditor

c                              = indicates this is a claim other than an identity claim

:0                            = place holder

–                              = indicates the ClaimType is a “role” or security group

.                               = indicates the ClaimValueType is a string.

t                              = indicates the AuthMode is for a trusted issuer

ADFS20                 = is the name of the trusted issuer of the claim

SPOWAEditor    = is the value of the claim.  In this instance the SPOWAEditor security group.

 

NOTE: The Claim Value is case sensitive.  “spOWAEditor” will not work it must be exactly as it is in the provider.  Here in Active Directory it is listed as “SPOWAEditor”.

Since I’ve built the claim string.  I can now create a claim string from it using the New-SPClaimsPrincipal cmd-let:

$claimString = New-SPClaimsPrincipal -EncodedClaim “c:0-.t|ADFS20|SPOWAEditor”

user-licensing-06

Since the claim string is built and populated I can go ahead and perform the license mapping using the newly created claim string variable and add the mapping:

 $map = New-SPUserLicenseMapping -Claim $claimString -License OfficeWebAppsEdit

$map|Add-SPUserLicenseMapping

user-licensing-07

Retrieve the current mappings using Get-SPUserLicenseMapping.  We can see that the new mapping has taken effect and shows the ADFS20 provider as the trusted provider for that mapping.

user-licensing-08

Repeat the same steps to complete the remaining mappings.  Now the three new ADFS mappings should be present and mapping is completed for both NTLM and ADFS providers.

Advertisements
Tagged with: , , , , , ,
Posted in ADFS, Licensing, PowerShell, SAML Claims, SharePoint 2013

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: