Haaron Gonzalez Rotating Header Image

SharePoint;

Just use a Office 365 based credential when deploying programatically

So all people happy and kind of impress with Office 365 Pattern & Practices components, especially the ones that are related to Office 365, is so much easier and simpler the provision things up to SharePoint Online. Recently had to deploy some assets into SharePoint Online, I did use Office 365 PnP as our deployment approach. Everything work just fine in our Office 365 Dev environment but as soon I got to customer tenant our deployment console app didn’t work as expected.

First I notice that customer had ADFS set up and the code when trying to authenticate was throwing the following exception:

Unhandled Exception: Microsoft.SharePoint.Client.IdcrlException: Unable to get ticket due to unknown error.
at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String securityXml, String serviceTarget, String servicePolicy)
   at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String username, String password, String serviceTarget, String servicePolicy)
   at Microsoft.SharePoint.Client.Idcrl.SharePointOnlineAuthenticationProvider.GetAuthenticationCookie(Uri url, String username, SecureString password, Boolean alwaysThrowOnFailure, EventHandler`1 executingWebRequest)
   at Microsoft.SharePoint.Client.SharePointOnlineCredentials.GetAuthenticationCookie(Uri url, Boolean refresh, Boolean alwaysThrowOnFailure)
   at Microsoft.SharePoint.Client.ClientRuntimeContext.SetupRequestCredential(ClientRuntimeContext context, HttpWebRequest request)
   at Microsoft.SharePoint.Client.SPWebRequestExecutor.GetRequestStream()
   at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()
   at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryImplementation(ClientRuntimeContext clientContext,Int32 retryCount, Int32 delay)
   at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryRetry(ClientRuntimeContext clientContext, Int32 retryCount, Int32 delay)
   at BrandingCAN.Program.Main(String[] args) in projectpath\Program.cs:line 41

Did some research and perform several recommendations, but unfortunately didn’t work at all. So, at this moment I still don’t understand what to do to make my console app to authenticate to O365 with ADFS set up and account. But, I did manage to solve the issue just using an Office 365 based credential instead of an ADFS based credential, and that’s what I wanted to share here.

Whenever you deploying something programmatically to O365, please use O365 based credentials like “accountname@company.onmicrosoft.com” and Office 365 PnP and all SharePoint Client APIs will perform as expected.

 

Formulas to get the first and last row on a repeating table in InfoPath

You know, you wake up knowing that is going to be a wonderful day working for a customer with the software products you love. During today on-site support session, you found out that is needed to write some good old XPath formulas on an InfoPath form.

There is a repeating table with the columns necessarily to describe travel information like Departure Date, Return Date, City, you named and the requirement was to expose the initial Departure Date and the last Return Date of the entire trip, so, what do we mean with entire trip? I maybe start a trip from San Diego to Mexico City, and then another trip from Mexico City to Seattle and then from Seattle to Las Vegas. Clearly, the Departure Date and Return Date are not associated with just one row “trip” in the repeating table because I have at least more than one row for describing all the trips.

The data structure of the repeating table is:

 

 

structure

So, here are the formulas to get the first and last row on a repeating table.

../my:TravelInfo/my:TravelInformation[count(preceding-sibling::my:TravelInformation) = 0]/my:DepartureDate

../my:TravelInfo/my:TravelInformation[count(following-sibling::my:TravelInformation) = 0]/my:ReturnDate

Fortunately, the approach work as a charm. No C# code saved the day today. Pure old good XPath did it. InfoPath, you are definitely the sunshine of my love, especially now that you will be supported until 2026 baby.

 

SharePoint pushed to its limits

championsHave you been interested in knowing how intranets get together? Or what practices teams follows in order to design/build/deploy and support an enterprise intranet? I did had the question too, and one of the resources I have been following for a couple of years now is the Nielsen Normal Group Intranet Design Award. This is a competition conducted by the Nielsen Norman Group called annual intranet design to identify the world’s 10 best intranets.

In this report you can see very interesting topics that will definitely give a broader idea on what it takes to build and deploy a top notch intranet. As a SharePoint consultant this also makes sense to review because you can see some real world SharePoint implementations, ideas, trends, features and approaches that maybe you didn’t know were possible.

Be aware that the report is not free, you need to pay for a licensed copy.

Congrats to BrightStarr for participating and winning this year!

 

A quick tale from the SharePoint support trenches

Basically, the customer had a workflow, build in SharePoint Designer 2010 that will use some of the out of the box Actions like the Pause for Duration and Send Email. The issue was that once the workflow paused for a minute it wasn’t able to resume the work, leaving the workflow always running “In Progress”. Doing some research found KB2674684 SharePoint 2010: Workflow failed to run after pause and according to the description made me remember my good old ASP.NET developer days.

The bottom line is that SharePoint on premise is ultimately a Microsoft ASP.NET solution that works with multiple windows services and related Microsoft technologies/servers. From the web perspective Web Server Controls, Web User Controls, HTTP Handlers, Web Services, AJAX, ASPX pages, assemblies, web.config, page directives and so on are just pieces that work together to deliver a page that end users to consume.

Turns out that if you have the Workflow Timer Service started on a server that is running as an Application Server role “App” and you don’t have the SharePoint Foundation Web Application service started “basically the WFE role”, workflows will fail rehydrating the workflow when resume from a pause action, the reason why?, is because in order to rehydrate a paused workflow SharePoint needs to read some settings from the running web application web.config file, but because we have only the “App” role and not the “App/WFE” role running, it fails loading from the required Web Application the web.config file, because THERE IS NO web.config to load for that particular web application in the App server. The App Server without the SharePoint Foundation Web Application Service started only has available the Central Administration web application, not those additional web applications that WFE have available in IIS as a web site.

According to the article there are three methods for solving this issue:

  • Method 1: Locate one Web Front End server, which has Web Application service running, run the following PowerShell command to copy workflow-related configuration from the web.config to the configuration database so it will be available from every server in the Farm.

$webapp = Get-SPWebApplication -identity http://<web app name>

$webapp.UpdateWorkflowConfigurationSetttings()

  • Method 2: Start the Web Application Service on all servers that have the Workflow Timer Service is running.
  • Method 3: Disable the Workflow Timer Service on servers that are not running the Web Application service.

I decided to use Method 3 because we have dedicated App server and dedicated WFE server.

By the way, if you have Nintex Workflow installed in your farm, what just explain also apply. Nintex Workflow should run only n WFE servers, so make sure you Workflow Timer Service is stopped on all app servers in your farm.

Thanks for reading!

Fail patching your SharePoint 2010 farm for apparent no reason

  • Act 1: You notice that health analyzer is warning you that some updates needed to applied on the server X and server Y.
  • Act 2: You download the KB2956080 and properly install on both good old SharePoint 2010 servers
  • Act 3: Run the psconfig -cmd upgrade -inplace b2b -wait command and “Missing installs error is displayed

How the play was called?

Fail patching your SharePoint 2010 farm for apparent no reason

At some point SharePoint loses track of the CU version information between the registry, windows installer and SharePoint but with just one magic PowerShell command you can force and fix the mismatch, the command is Get-SPProduct -Local , just run on the servers that display the Missing error then run the Configuration Wizard or PSConfig.

Cast

 

 

 

Discover SharePoint Web Services methods and parameters and feel nostalgic about it

This is not the first time that a customer has an issue with SharePoint Web Services “. asmx” and InfoPath Forms that I need to quickly spot and fix. Of course SharePoint Web Services work as a charm, but sometimes the problem comes more to InfoPath forms how they consume the services SOAP response and request headers. Yes, I’ve said InfoPath. A lot of customers still work and use InfoPath forms, they created and automated HR or IT process using these wonderful technologies and we, support engineers need to support. A lot of customers still have a dependency on InfoPath.

Today I want to share a resource that is not the first time that help me identify the problem and that is .NET Web Service Studio, this application is a .NET client application that you can use to discover the Methods of a web service and review the SOAP request and response parameter.

Very handy to start understanding a web service. So because this is like the third time I’ve used these tools to start supporting an InfoPath Form here you have it:

Just go to WebServiceStudio a codeplex, hit Download and enjoy the ride. There is some nostalgic feeling working and using the tool.

Just look the icons, don't you feel little nostalgia?

Just look the icons, don’t you feel little nostalgia?

Thanks Microsoft & SharePoint Community

MVP for 11 years now, but always feel like the first time. Thanks to Microsoft for the MVP Award this year. Also thanks to my fellow colleagues and SharePoint community for their awesomeness. I am proud and happy to be around another year especially when new version of our favorite product is coming.

Thanks.

 

Speaking at SharePoint Saturday San Diego

Got approved to participate as speaker in the SharePoint Saturday San Diego event next November 15, 2014. Awesome content, awesome speakers, awesome venue, awesome city. I will share some experiences on how to enhance document collaboration with SharePoint, what out of the box features we can use to simplify how people collaborate en enhance the end user experience. Those little tips & tricks that make the difference for end users.

Event Details:

Registration
Schedule

Session Details:

Enhance the way people collaborate with documents in SharePoint 
Come and learn those extra settings we can turn on to enhance the way people collaborate with documents in SharePoint. There is a set of out of the box settings available in a document library that we can configure to provide a friction free experience for document authors and content consumers.

 

SharePoint Saturday San Diego

SharePoint Saturday San Diego

Administrator-approved form template, what really happen?

I receive a question around Administrator-approved InfoPath form templates. Here is the answer.

Q. Haaron, what really happen when we upload a new version of an InfoPath form in central admin?

A. When you upload an InfoPath form template using SharePoint Central Administration some things happen:

1. In Manage Form Template you can provision the same version of the form in more than one Site Collection, you can manage the form, activate or deactivate.

IP04

2. It creates a WSP file based on your InfoPath Form Template version and deploys as a farm solution, automatically creates a Site Collection Feature that you can Activate or Deactivate.

IP03

IP05

3. In Manage Form Templates page, when we Activate To a Site Collection basically activate a Site Collection Feature in the target Site Collection, and that provision the form in the Form Templates library.

IP06

4. Behind the scenes, when the WSP is generated SharePoint maintain a version of the form template. That make sense because forms instances can point to older version of the template

IP07

And this behavior is the same for MOSS 2007, SharePoint Server 2010 Enterprise and SharePoint Server 2013 Enterprise.

Slides for my session at SharePoint Saturday Gulf

Thanks attendees for share with me during this presentation. Here are the slides of my session: