Archive for the ‘SharePoint 2013’ Category

SharePoint 2013 – Cannot activate Sandbox code solutions

September 4, 2016

We have a couple of sandbox no-code solutions in our Castlepoint product, and on a new SharePoint 2013 farm I could upload them but the Activate button wouldn’t enable.

Then I realised that I hadn’t started the Microsoft SharePoint Foundation Sandboxed Code Service yet… oops! Started the service on my application servers, and then when I tried to Activate the solution the button was enabled immediately.

Advertisements

Problems with SharePoint Designer 2013 and Check In Check Out Actions for Current Item

September 3, 2016

Problem – I want to check out the “Current Item” in my SharePoint Designer 2010 (using SPD2013) workflow, but the “Current Item” property isn’t available to select. I either have a blank list to choose from, or the lists in the root website to choose from. My workflow is associated with a site collection content type.

I had to use the a cached copy for the solution (original article here) so I’m re-printing it here. Following is the text from the original article:

The Requirement:

Create a workflow that will make field updates to a document or page that requires check-in / checkout. This workflow must be able to work on any page or document library in the site collection.

The Solution:

A modification to the .xoml file that tells the workflow to use “this item” regardless of the list.

Disclaimer: If you want to model an out of the box workflow, always copy and modify…it is never a good idea to modify the out of the box global workflows directly.

Steps:

  1. Set up your workflow with placeholders for your check-in and checkout actions.
  2. Add “Check out item in this list” and “Check in item in this list with Comment” actions to the appropriate steps on your workflow.
    1. Do not select a List. Leave the “this list” as is.
  3. Save your workflow.
  4. Go “All Files”, “Workflows”, click on the workflow name in the window below “All files” so that your workflow displays it’s files in the window on the right side of the screen.
  5. Right click on the .xoml file and click “Open With”, “SharePoint Designer (open as XML)”
  6. Save this file.
  7. Click on “Workflows” and click on the workflow name to open the workflow file as you normally would.
  8. Do not make any changes but click “Save”
  9. When Designer pops up to say that a different version of the .xoml file was saved, and politely asks if you want to replace that file with this one click “No”.
  10. Close Designer and re-open it
  11. Click on “Workflows” and click on your workflow to open and edit it.
  12. Find the step where you checked out and checked in the item.
  13. The action should say “Check out item in Current Item” and “Check in item in Current Item with comment: xxx

 

I’m not sure why you have to close Designer and re-open it before you can see your changes, maybe it’s just my wonky machine, but I have to follow these steps exactly on order for the change to “take”.

Notes:

Make sure that you do NOT have “end on change” feature turned on, or your workflow will stop immediately after making the change without checking the document back in.

HOWTO Fix SharePoint 2013 and Workflow Manager Configuration

August 14, 2015

The configuration and integration between SharePoint 2013 and Workflow Manager is hard. Really hard – when it doesn’t work straight away. Workflow Manager is a stand-alone product, integration between SharePoint and WM is all done via PowerShell, diagnosing issues between WM and SharePoint is problematic, and there doesn’t seem to be a concrete method to guarantee it will work. Many articles say “just rebuild your SP farm and/or Workflow farm”. Ouch.

Let’s work backwards to solve the problem. SharePoint Designer 2013 is looking for two configuration items to be completed before it will let you create SharePoint 2013 workflows.

  1. The Workflow service proxy is configured and working (via Central Admin)
  2. The Workflow Service feature is configured and working (via PowerShell)

Both of these components must be enabled and functioning in order to tick the boxes in SharePoint Designer 2013. If either fails, SharePoint Designer will not allow you to create SharePoint 2013 workflows.

The Workflow service proxy (1) connects to the Workflow services system. The Workflow Service feature (2) is a SharePoint feature that must be enabled and configured via SharePoint Powershell for the site collection. Lets got through all the components.

Checking Workflow Manager Service Configuration

Use the following Workflow Powershell commands to view the server configuration:

Get-WFFarm | format-list

This should return the following:

RunAsAccount      : <hostname>
AdminGroup      : <hostname>
HttpPort      :    12290
HttpsPort    :    12291

Endpoints   : <https://my.workflow.url:12290&gt;

You should be able to use your browser to access the Endpoint and return an Xml configuration page.
To get the Farm status use:

Get-WFFarmStatus | format-list

This should return the following:

HostName      : <hostname>
ServiceName   : WorkflowServiceBackend
ServiceStatus : Running

HostName      : <hostname>
ServiceName   : WorkflowServiceFrontEnd
ServiceStatus : Running

The ServiceStatus “Running” is the important part here.

Checking SharePoint 2013 Workflow Service Configuration

Use the following SharePoint 2013 powershell commands to view Workflow Service configuration:

Get-SPWorkflowConfig -SiteCollection [sitecollectionurl]

Get-SPWorkflowServiceApplicationProxy | format-list

Validate that the Endpoints are correct, and you can indeed navigation to them.

Checking SharePoint 2013 Workflow Proxy Application

The workflow proxy application is available through the Central Admin, Manage Service Applications interface. Clicking on the Workflow service application should show you the following:

Workflow - Service Application Proxy Status

Fixing SharePoint 2013 Workflow Service Feature

The following SharePoint Powershell command forces the Workflow Service feature to be enabled:

Enable-SPFeature -Identify WorkflowServiceStore -url <site collection url> -Force

I received this error when I didn’t use the -Force parameter:

Enable-SPFeature: The field with id {GUID} defined in feature {GUID} was found in the current site collection or in a subsite.

SharePoint 2013 CU2 Upgrade Issues with Workflow Manager

During a recent upgrade of our SharePoint farm I noted the following warning in the upgrade log file:

WARNING Error UpgradeWorkflowServiceActivities.  
Run Copy-SPLocalActivitiesToWorkflowService manually to complete this action.  
Error: Microsoft.Workflow.Client.WorkflowEndpointNotFoundException: Unable to connect to the remote 
service at http://<servername>:12291/SharePoint/. See InnerException for more details.

It turned out that during the upgrade the IIS service was offline, so the workflow management endpoint was also offline. There doesn’t actually seem to be a Copy-SPLocalActivitiesToWorkflowService powershell command, but there is a Copy-SPActivitiesToWorkflowService. I ran that command with the following details (i’m using HTTP in my test environment):

$cred=[System.Net.CredentialCache]::DefaultNetworkCredentials
Copy-SPActivitiesToWorkflowService -WorkflowServiceAddress "http://<servername>:12291/SharePoint" -Credential $cred -Force $true

Addendum: Workflow Manager and Service Bus CU2

Service Bus 1.0 Cumulative Update 2 (CU2)

Workflow Manager 1.0 Cumulative Update 2 (CU2)

HOWTO Get the Search Service Topology Status and Search Health Detail

April 16, 2015

I found this fabulous PowerShell script on GitHub:

https://github.com/chrisdee/Scripts/blob/master/PowerShell/Working/SharePoint/SharePoint2013/SP2013GetSPSearchServiceTopologyState.ps1

It gives a far more detailed status of Search health and will hopefully mean less index resets for me in the future!

HOWTO Change a SharePoint 2013 Host-Named Site Collection HNSC to a Path-Based Site Collection

January 29, 2015

I came up with this issue in our DEV SharePoint 2013 environment. I had created a host-named site collection using the powershell command:

New-SPSite -URL http://hostnamedsitecollection -WebApplication http://webappname

but I wanted to move it to it’s own host-header web application instead. Advice on the Internet is to backup-restore the content via Backup-SPWeb or other similar mechanisms such as import-export. However the site collection was pretty big and it would have taken a while.

STANDARD WARNING: The following steps involve direct editing of a SharePoint 2013 Content Database and is not supported by Microsoft etc etc end of the world etc etc

In SQL Server on the content database, the command:

SELECT Id, HostHeader
FROM dbo.AllSites

displays the host header url set against the site collection. Editing this value and setting it to NULL clears the host header setting. The process I used was as follows:

1. Remove the content database from the host-header Web Application #1
2. Change the HostHeader field to NULL in the content database
3. Re-attach the content database to the host-named Web Application #2

SharePoint should re-attach your content database, check the dbo.AllSites table, and add your site collection to the website using normal path-based site collection.

Yes, it’s a hack!

HTH

SharePoint 2013 Remote Blob Storage Stops Working after December 2014 Cumulative Update

January 12, 2015

I upgraded a test environment over the weekend that had the SQL Server 2012 Remote Blob Storage provider configured and working. After the upgrade I got errors accessing Remote Blob Storage files, with a “Permission Denied” SQL error appearing in the ULS logs.

The Web Application account in use by SharePoint was a member of the DBO role to enable Remote Blob Storage to work properly. After the Cumulative Update was applied, this permission was gone. I added the permission back via SQL Management Studio, and Remote Blob Storage worked again. CU quirk perhaps?

HOWTO Configure Shredded Storage in SharePoint 2013 using FileWriteChunkSize

January 8, 2015

We have installed Remote Blob Storage and wanted to ensure it was used by modifying the FileWriteChunkSize for Shredded Storage. The configuration is performed against the Web Application that your Remote Blob Storage-enabled database is attached to. The following commands will configure Shredded Storage FileWriteChunkSize for 4MB files:

$webapp = Get-SPWebApplication http://yourwebappurl
$webapp.WebService.FileWriteChunkSize = 4194304
$webapp.webservice.Update()

More information is on TechNet here:
http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.administration.spwebservice_properties(v=office.15).aspx

UPDATE: Thanks to Mario Alvares for pointing out a Bill Baer presentation on appropriate settings for FileWriteChunkSize.

Fixing SharePoint 2013 Unexpected SPAudienceValidator Audience URI is not valid for context

November 28, 2014

We had created a site collection on a web application with the wrong URL and needed to change it. An accepted method is to remove SharePoint from IIS and re-add via:

Update a web application URL and IIS bindings for SharePoint 2013

However after bringing the new site back online I got site errors when visiting:

Cannot find site lookup info for request Uri http://%5Bsite%5D

Unexpected SPAudienceValidator: Audience Uri http://%5Bsite%5D is not valid for the context.

I tried to do an IISReset but that didn’t resolve the issue. Looks like a caching problem, so instead I restarted services as follows:

  1. IIS Admin Service
  2. SharePoint Administration
  3. SharePoint Timer Service
  4. World Wide Web Publishing Service

After IIS returned to service and SharePoint had reloaded, the issues disappeared.

 

 

 

ULS Log Viewer v2 for SharePoint 2013

September 18, 2014

Microsoft has released an updated version of the ULS Log Viewer application for SharePoint 2013. Get it here:

http://www.microsoft.com/en-us/download/details.aspx?id=44020

Fixing “The user has not been granted the requested logon type at this computer” for SharePoint 2013 AutoSPInstaller

September 18, 2014

We are deploying SharePoint 2013 using the AutoSPInstaller PowerShell scripts in our Development environment and were getting the following issue:

Start-Process : This command cannot be run due to the error: Logon failure: the user has not been granted the requested logon at this computer.

We are using service accounts to manage security for our SharePoint 2013 applications and services, and the configuration for AutoSPInstaller includes which service accounts are applied to the various SharePoint components.

You can test a particular service account using the following PowerShell script:

Start-Process -FilePath cmd.exe -ArgumentList "/C" -LoadUserProfile -NoNewWindow -Credential Get-Credential

which will prompt you for the account credentials you want to test and then try and create a command prompt with the users profile.

The issue we found was as follows:
1. The Local Security Policy setting for Allow Log On Locally included Administrators, Users and Backup Operators. The service accounts are members of the Users group which should have allowed the required permissions.
2. The Local Security Policy setting for Deny log on locally was set to a specific security group, of which the service account was a member.

The Deny log on locally setting overrides the Allow log on locally setting. Once we removed the service account from the Deny log on locally setting, the AutoSPInstaller process worked perfectly!