Showing posts with label SharePoint 2013. Show all posts
Showing posts with label SharePoint 2013. Show all posts

Tuesday, July 5, 2016

SharePoint 2013: Internet Information Services is not installed?

Symptoms:
While attempting to run the "SharePoint Products Configuration Wizard" for SharePoint 2013. You get a dialog which states:
"Internet Information Services is not installed. You must have Internet Information Services installed in order to use the SharePoint Products Configuration Wizard."
But your sure IIS is installed.

Issue:
Some IIS dependent services might not be running.

Fix:
Open up the Services Management Console (Press the Windows key. Then start typing Services. Open "Services")
Ensure the following services are running:
IIS Admin Service
World Wide Web Publishing Service

Monday, February 3, 2014

SharePoint 2013: "Sorry, we're having trouble reaching the server"

Trying to add users to SharePoint groups.

When I type in a name I get the following message: "Sorry, we're having trouble reaching the server"

I had been tinkering with the web app directly in IIS (don't try this at home) and I disabled "Anonymous access". 

Apparently this is necessary for SharePoint to function. So don't mess with it.

Wednesday, November 20, 2013

SharePoint 2013: RemoteAppUrl is not specified.

Situation: I've built a Provider Hosted SharePoint 2013 app. It's been working happily until I went to "clean up the project". I made a couple of changes to the IIS Web App project properties and now when I try to deploy my app to SharePoint I get "RemoteAppUrl is not specified."
But it doesn't provide any clues as to how this can be fixed.

Fix:
In Solution Explorer.
Right click on the Web App and click Properties.
Open up the "Web" section.
Under Servers check "Apply server settings to all users (store in project file)".

Why?:
I believe if you have this unchecked Visual Studio won't set the "RemoteAppUrl" in the AppManifest.xml and thus the message.

 

Sunday, October 6, 2013

SharePoint 2013: CSOM List Permissions in C#

Intro: I'm building a SharePoint 2013 provided hosted app. I had a requirement to retrieve permissions for the current user to a particular list. I want to enable/disable a checkbox depending on their ability to add/edit items in a particular SharePoint list. So I search around and find this:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.list.effectivebasepermissions.aspx
Unfortunately there's no sample in the above article and aren't any examples of how to use it anywhere on the web.

Issue: The EffectiveBasePermissions isn't loaded unless you specifically ask for it. This is the CSOM way.

Solution:
using (var clientContext = new ClientContext(hostWeb))
{
    Site site = clientContext.Site;
    clientContext.Load(site);
    clientContext.ExecuteQuery();

    Web web = site.OpenWeb("Name of spweb");
    clientContext.Load(web);
    clientContext.ExecuteQuery();

    List list = web.Lists.GetByTitle("Name of List");
    clientContext.Load(list, l => l.EffectiveBasePermissions); 
    clientContext.ExecuteQuery();

    bool myAddPermission = list.EffectiveBasePermissions.Has(PermissionKind.AddListItems);
    bool myEditPermission = list.EffectiveBasePermissions.Has(PermissionKind.EditListItems);
}

The code above will more than likely get the permission of the IIS App pool running your app. You may need to change the credentials in which the clientContext is running:
clientContext.Credentials = new NetworkCredential();

Explanation:
When writing server side code we can get all the data for the Web or list. Because we can afford to. But when we use CSOM we want to minimise the amount of data going back and forth. So the clientContext won't have the "EffectiveBasePermissions" unless you tell it to.