Thursday 28 August 2014

Monitoring SharePoint Public Websites

Overview:  This post is applicable to public website and not just SharePoint, I have used it for SharePoint and feel it is a good product.  The principle will apply to other monitoring products and services.

AlertFox is a SaaS monitoring service.  It allows me to monitor various websites using http posts or complicate macros to perform various steps such as logging into a website using ACS.  This differs from an internal monitoring service such as Solar Winds but it definitely has it's place.  I discuss various monitoring options in this post.

The benefits are:
  1. You are notified when the site is down and what the issue is from a web request point of view.
  2. You are monitoring externally so you can see what you customers see.
  3. You can see if your response time are slowing down.
  4. You keep the IIS webservers warmed up (so if you have an app pool recycle).
  5. Easy to monitor and you can setup alerts.
  6. Complex scenarios can be accounted for in testing so you know the complex parts of your site are working.
Image 1. See when you have problems, what the issue is and when it occurred.


Image 2. Verify the performance from around the world

Image 3. Check uptime

 

Tuesday 19 August 2014

SharePoint 2013 on-prem using Windows Live Id via Azure ACS

Overview:  I have a pretty simple requirement to allow users to register on my customers public SharePoint 2013 web sites.  I have setup custom providers and thought ACS was going to make me a hero at my client.  The whole experience is terrible and I can't see why anyone would use the default of LiveId via ACS due to the implementation.

Opinion: I hate the way ACS works with Windows Live Id, it is so bad I can't see a scenario when a client would use it.

Anyway, I have SP2013 SP1 on-prem and I want to hook at ACS allowing customer to register on the site and get elevate permissions on the site.  I'd like them to use multiple 3rd party authentication providers such as Facebook, Windows Live Id, LinkedIn and Google.  In my PoC I decide to simply use Live Id as it is the default on ACS and as both services are Microsoft owned it must be the easiest. 

I worked thru Wictor Wilem's post series and as usual Wictor has provide a great resource.  I had to make minor adjustments to get it to work for me on SP2013 but overall, Wictors series of posts is a good place to start.

The 1st issue I got was when logging in using Windows Live ID, I was continuously redirect back to the /_login/default.aspx page.

After bashing my head trying to figure out what the issue was I realised in Wictor's common issues post in the series, he mentioned the claims mapping/rule needs to be adjusted for Live ID authentication. 

I now was getting an access denied, which at least told me the claim was hooking up.

The next issue was now I was getting the message you are not authorised "Sorry, this site hasn't been shared with you."

Give all authenticated users access to the site as shown below.

Once you login you will notice a horrible looking user that is logged in.   You can assign permissions using the "Friendly Username".


Common public Federation (IdP) Identifcation provides are:
  • LiveId (MS - not where you would expect the MS offering to be)
  • Google (constantly changing - easy hookup)
  • FaceBook
  • LinkedIn
Common Enterprise IdP Servers/Services are:
  • Microsoft ADFS (best default option for greenfield SP)
  • PingFederate (pretty expensive but a comprehensive solution, use if already in place or the advanced features really suit the business at an enterprise level)
  • ThinkTextures IdentityServer (Great for customisation, difficult support but for the hardcore tecky type organisation a good option)
  • CA-SiteMinder (Good product, used in enterprises and hooks up well to SP.  Has a large set of tools and options).  Update: 19-Nov-2015, seen another large implementation of SiteMinder, it has expensive add-in modules and extremely problematic.  SP agent needs AD groups.
  • RSA Federated Identity Manager (No experience)
  • Entrust GetAccess (No Experience)
  • IBM Tivoli (CAM) (Had a hard time with this a few years back)
  • ComponentSpace (Good for .NET customisations, not a large Federation service Server)

Saturday 9 August 2014

PowerShell to Create and Remove Promoted Search Results in SharePoint 2013

Overview: I want to manage promoted results programatically.  PowerShell is a good candidate for automating the creation of "Promoted Results" previously/also known as "Search Best Bets".

In this post I provide PowerShell to create promoted results at the site collection.  The image below shows that my search has picked up 2 pages in my site collection.  I want to display a promoted result when a user types in certain terms in y case the search term is "Messi".  The picture bellows explains what I'm achieving through PS using promoted results.

To manually create Promoted Results:
  1. On the Site Collection, go Site Settings > Search Query Rules
  2. On the page select "All Sources" for the qu "For what context do you want to configure rules?"
  3. And select "Promoted Results Contains", you can add Promoted Results/Best Bets thru the UI at this point.
Or Open PromoteResults.ps1 and edit the Powershell to create the promoted results for you, comment out the DeletePromoteResults, as it is used to roll out the changes.
Run PromoteReults.ps1. 
Search for the term "Messi" and you will see the promoted result.
 
 

Friday 25 July 2014

Office Web Apps 2013 for public facing websites

Overview:  A couple of weeks ago I told a customer that Microsoft offers a service to display Office documents thru Office Web Apps (WCA).  I thought I had read this or seen it on twitter but I was confident that viewing website office based documents was a free service offered by Microsoft.

Initial Hypothesis:  I looked on the web and could not find anything and I had to hastily tell the customer I had made a mistake as I could not find anything about it on the web.  The customer decided to setup a public facing Office Web Apps Server to feed up office documents and pdfs for their websites.

Fast forward a few weeks and the customer is installing a 1 server office web apps farm to display pdfs and word document from their public websites and I have been informed that there actually is a public service.  http://blogs.office.com/2013/04/10/office-web-viewer-view-office-documents-in-a-browser/

"Do you have Office documents on your website or blog that you want your readers to view even if they don’t have Office installed?  Would you rather view a document before downloading it?  To give your audience a better experience, try the Office Web Viewer."

To use the service there are a couple of considerations.  The service only supports office documents like word and excel, it doesn't support pdfs which is the clients preferred method of providing downloads.

Resolution:  You do not need to perform WOPI binding to use the service. 
The document is located at: http://calibre-ebook.com/downloads/demos/demo.docx

All you need to do is prefix the url link as follows:
http://view.officeapps.live.com/op/view.aspx?src=http://calibre-ebook.com/downloads/demos/demo.docx
 
Summary: A nice service offered by Microsoft for viewing Office documents "on-the-line" O Wilson, V Vaughn 2013 (The Internship).  If won't work for pdfs and you will need to call the service in the html call.  Good to know it is available but it won't meet my clients needs.

Tip: Ensure the link opens a new tab as the opened pdf will lose the clients context on yor site and force them to use the browsers back button.

Note: To get WCA to open public documents on the web using the web viewer, you need to setup the SharePoint farm to use "external-https".  If you are using it both internally and externally, which I have not done, you need to use external-https and use Alternate Access Mapping (AAM).

Example:
Below is a single WCA server farm that I am using for both internal e.g. document libraries & external i.e. public SharePoint 2013 websites.  Note the Internal and External URL are the same, you could also use AAM as suggested earlier.

FarmOU                            :
InternalURL                       : https://wca.demo.co.uk/
ExternalURL                       : https://wca.demo.co.uk/
AllowHTTP                         : False
SSLOffloaded                      : False
CertificateName                   : wca.demo.co.uk
EditingEnabled                    : False
LogLocation                       : E:\OfficeWebApps\Logs\ULS\
LogRetentionInDays                : 30
LogVerbosity                      :
Proxy                             :
CacheLocation                     : E:\OfficeWebApps\Working\d\
MaxMemoryCacheSizeInMB            : 5000
DocumentInfoCacheSize             : 5000
CacheSizeInGB                     : 40
ClipartEnabled                    : False
TranslationEnabled                : False
MaxTranslationCharacterCount      : 125000
TranslationServiceAppId           :
TranslationServiceAddress         :
RenderingLocalCacheLocation       : C:\ProgramData\Microsoft\OfficeWebApps\Working\waccache
RecycleActiveProcessCount         : 5
AllowCEIP                         : False
ExcelRequestDurationMax           : 300
ExcelSessionTimeout               : 450
ExcelWorkbookSizeMax              : 10
ExcelPrivateBytesMax              : -1
ExcelConnectionLifetime           : 1800
ExcelExternalDataCacheLifetime    : 300
ExcelAllowExternalData            : True
ExcelWarnOnDataRefresh            : True
OpenFromUrlEnabled                : True
OpenFromUncEnabled                : True
OpenFromUrlThrottlingEnabled      : True
PicturePasteDisabled              : True
RemovePersonalInformationFromLogs : False
AllowHttpSecureStoreConnections   : False
Machines                          : {EXT-WEBDEMO1}

I am using a SSL certificate installed on the WCA box as I don't have an SSL termination device (F5, Kemp).

On the WCA VM I run the PS > Set-OfficeWebAppsFarm -OpenFromUrlEnabled:$True

This gives me the generate.aspx page on the WCA farm to provide pdfs and office documents via the web viewer.  Mine is https://wca.demo.co.uk/op/generate.aspx

SharePoint 2013 OOTB lookup list filtering

Problem
I don't want to start customising my solution and I need a lookup column with restricted options.  I read this post from April Dunnam via Google and it's awesome and I wish I had thought of it first.

I have 2 lists: Countries (Country, Continent) & Business (Name, LocationInAsia, LocationInEurope).  I want to be able to specify their head office in each continent.  I could do a lookup list to country and show all the countries or I can use Aprils approach and only show Countries for the specific region.  This is a contrived example but it's a simple way to explain it.

Resolution:
On the Countries list create a Calculated column/field, call it "AsianCountries". 
The formula is =IF([Continent]="Asia",Country,"")
On the Business list, create a lookup called "LocationInAsia" that points to the "AsianCountries" field in the Countries list.

http://www.sharepointsiren.com/2013/05/sharepoint-2007-2010-2013-filtered.html

Summary:
This is pretty useful in that I don't need to write and custom code to have lookup lists that only show the appropriate content.  Sure I need to have extra calculate columns but a good no code way to restrict lists lookups.


 

Saturday 12 July 2014

SharePoint 2013 Search Series - Post 3 - Search Box Web Part to only query Managed Properties

Search Series:
SharePoint 2013 Search Series - Post 1 - Configure Custom Search
SharePoint 2013 Search Series - Post 2 - Refiners
SharePoint 2013 Search Series - Post 3 - Search Box Web Part query Managed Properties(This Post)
SharePoint 2013 Search Series - Post 4 - Search Result Source Removal
SharePoint 2013 Search Series - Post 5 - Restricting Results & Enable pdf previews

Overview:  In this post we are looking at using a Display Template to change how the Search input box works.  Specifically the example will look at making the search box only search on the Title property of documents.  It will search for any part of the title.  If my word document is called "Std-634-HealthandSafety", using the search term "634" we get the document.

Steps to Change the way the Search Box works:
1.> Copy the Display Template "Control_Display Template", edit & rename the new template and upload to the Display Template gallery.
2.> Change the Title element tag in the Display Template and amend the html as shown below to change the behaviour of the search box.
3.> When the html display template is uploaded, you will notice the js file with the same name is updated.  Remember to Publish the html display template.
4.> On the Search Page edit or add the Search Box Web Part.  Select the Display Template, in my case it is "Demo Title Search Box" and save.
Search now only does a wild card search on the Title of the uploaded documents (assume the content has been crawled).

Search Series:
SharePoint 2013 Search Series - Post 1 - Configure Custom Search
SharePoint 2013 Search Series - Post 2 - Refiners
SharePoint 2013 Search Series - Post 3 - Search Box Web Part query Managed Properties(This Post)
SharePoint 2013 Search Series - Post 4 - Search Result Source Removal
SharePoint 2013 Search Series - Post 5 - Restricting Results & Enable pdf previews