Tuesday, October 27, 2015

SharePoint 2013 configuration wizard fails at step 8 "failed to create sample data"

So, I have been scratching my head about this for a day before I finally found the solution.
For some reason, after installing updates on my SP2013 machine, running the SharePoint Config Wizard kept failing at this point.

DB was up and responding, everything seemed fine, central admin worked, I could even access my sites with no problem.

Then I found some message in a forum that made me wonder, would it be because I deleted a web application before the updates?

The answer seems to be yes.

I used to have a SharePoint web application on http port 80 that had a dummy site that no one used.

It appears that once I deleted it - I started getting this error.

The solution was simple:

Visit the central administration, create a web application on default port 80, and create an empty site collection in its root.

Run the wizard again, and now this step passes with no errors.

Good luck!

Edit: while writing this post, I encountered another strange scenario which produced this same error:
The W3SVC service stopped, and stopped all sites with it.
Start the service and sites resolved this issue.

Monday, May 11, 2015

Strangest error using power shell to connect to SharePoint online

My simple power shell script which I used to create large lists stopped working, reporting the following strange error: "The Application ID (AppID) for which the service ticket is requested does not exist on the system." After struggling with what appears to be a mess of people reporting it on different forums and blogs, even offering vudu solutions on how working from home would cause this issue, and running to the office might resolve it - I almost gave up. Until I noticed my login user name had a typo in it. Correcting it resolved the issue - so I guess this error message is actually a login user name / password are wrong... The error comes as soon as you try to create client context or pull any information. Not saying there couldn't be any other causes for this issue, just be sure to triple check you provided the correct login information... my code: $User = "user@domain.com" $SiteURL = "https://sometenant.sharepoint.com" $Password = Read-Host -Prompt "Please enter your password" -AsSecureString $Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password) $Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password) $Context.Credentials = $Creds ... Good luck!

Monday, March 23, 2015

App part does not show custom properties

Something very strange was happening on my dev sites on SharePoint online.

Suddenly, my app parts “lost” all their custom properties and when ever I would go to add/edit an app part to my pages I would only see the built in app part properties groups: appearance, layout and advanced:

imageFor some reason, on my other non-dev tenants it always worked perfectly, this issue was only with my dev environments.

After reporting this to Microsoft, I got the following KB article back as a possible solution:

https://support.office.com/en-us/article/Turn-scripting-capabilities-on-and-off-1f2c515f-5d7e-448a-9fd7-835da935584f?ui=en-US&rs=en-US&ad=US

It suggested a new feature that was introduced a while ago and turned on by default to everyone could be the cause for this issue.

It suggested to allow custom scripts on my site pages, and that should do the trick. Now, there is a note in that settings page saying it might take up to 24 hours for this change to take place after you visit the settings page, so did it work?

image

I did confirm this issue happens with all app parts that have custom properties, I have tested few other app parts from the store and they all exhibited the same behavior on my dev sites.

I guess I will test it tomorrow and have to update you… fingers crossed…

Thursday, February 19, 2015

Building .NET client tools for SharePoint online

Hi guys,
Here is my presentation from today's webcast.

If you wish to see the webcast recording click here.


Thanks for joining me, please feel free to comment on this post if you have questions about this topic.
For more resources, please visit the last page of the presentation for additional links.

Shai.

Tuesday, February 17, 2015

Speaking Engagements 2015


Just FYI, my speaking engagements for 2015 are posted here, If you are around – come see me!

If you were in one of my sessions, you can find links to the session code and presentation below.

Also – if you have any comments on my session – feel free to post it here!

February 19Online webcast - Building .NET Client Tools for SharePoint Online

March 19 – Victoria SPUG - The future of full trust solutions: Migration & Upgrade

June 6 - SPS Calgary - (2 topics) The future of full trust solutions: Migration & Upgrade ; How I built my first commercial SharePoint hosted app

June 17 - SPBiz online conference - Building .NET Client Tools for SharePoint Online

June 18 – Hamilton SPUG - Building .NET Client Tools for SharePoint Online

July 25 - SPS NYCThe future of full trust solutions: Migration & Upgrade

Thursday, February 12, 2015

IE8 can’t handle split by regex

FYI, this is a very strange bug I just stumbled upon in IE8, even other IE versions running in IE8 mode (which means – anyone using IE with SharePoint 2010)…

It appears while IE8 can handle a simple string split by character, such as “a,b,c,d”.split(“,”) – it is having a really hard time working with a regular expression split.

It is supposed to be supported, it is working on any other browser including IE9+…

Here is what I have, splitting a string by matching tokens inside [ ]:

var arr = str.split(/\[(.*?)\]/);

All browsers will return all text before, inside and after the matches.

IE8, it appears, is the only one out of the bunch not returning the text inside the token.

BTW, if you ask me – IE8 is the only browser who is actually doing what I asked – which is to split by the match, while I would say all other browsers are in the wrong – splitting by the matches themselves in the regex… but if all browsers do one thing and IE8 does another, it just makes it impossible to rely and use this API.

Well, off to find another solution.

Monday, January 26, 2015

Strange user login name in SharePoint when using Claims?

Hey, if you are like me and use claims to login to your SharePoint, you probably noticed the user names went nuts.

Having a user name like domain\user will now return something more like i:0#.w|domain\user if you are lucky, but I’ve seen stranger formats as well…

Now, say a user sends you a login name (domain\user) and you need to get this value and set it to the assigned to of a task, or set permissions for this user – you will quickly find out you cannot get an SPUser object from this standard login name.

Also, when you want to send the login name to another system or work with it in your code – you might want to get just the domain\user part, without the claims decorations.

True, the claims login formats are documented and you can hope to parse the format yourself to extract the user login from it, but I recently found a hidden (to me at least) gem in SharePoint API that can help with this task.

First, start using this namespace: Microsoft.SharePoint.Administration.Claims;

Now, you can work with SPClaimProviderManager object to check if a string is a claims encoded user name, and convert it to a standard user name, and the other way around.

I’ve created this simple utility class for me to use in my code for now, here is a code sample explaining how to use this object:

public class ClaimsHelper
{
    public static string ClaimsToLogin(string login)
    {
        try{
            if(SPClaimProviderManager.IsEncodedClaim(login))
                return SPClaimProviderManager.Local.ConvertClaimToIdentifier(login);
        }
        catch{
            //log error, return the origina value we got
        }
        return login;
    }
    public static string LoginToClaims(string login)
    {
        try
        {
            if (!SPClaimProviderManager.IsEncodedClaim(login))
                return SPClaimProviderManager.Local.ConvertIdentifierToClaim(login, SPIdentifierTypes.WindowsSamAccountName).ToEncodedString();
        }
        catch
        {
            //log error, return the origina value we got
        }
        return login;
    }
}

(Code is for example purposes only, use at own risk, feel free to change the names of the helpers)


Notice I’m expecting to get a windows login user name (SPIdentifierTypes.WindowsSamAccountName) but you can change this to support your own authentication.


Good luck, hope this help.

Tuesday, January 20, 2015

Proudly Canadian?

Great! So am I.
So, visit our site and get your choice of a free SharePoint product:
http://www.kwizcom.com/special-offers/canadieneh/
Canadian_campaign_800_320
My personal favorites you should be looking at:
  1. Data View Plus – since it is the Swiss army knife of all SharePoint viewers out there!
  2. List inline editor – I use it all the time, this one saves me literally hours of data entry or updating bugs every single day.
  3. Forms w/Custom actions – need I say more?? If you don’t know what its all about, check out this quick video http://www.kwizcom.com/sharepoint-add-ons/sharepoint-list-custom-actions/overview/
  4. Wiki Plus – Company procedures? Publish articles? Want to be able to use *real* wiki language with quick TOC?
Wow – it was hard coming up with just 4, anyway – one is yours to keep for free. Sound off in the comments for questions or feedback (guys, no support questions here please – for that visit http://support.kwizcom.com/Default.aspx or http://forum.kwizcom.com/Default.aspx as I can’t really help you in the comments)