Wednesday 1 November 2017

Using a CDN for Custom User Actions

Problem:  I need to inject JavaScript into a couple of hundred thousand site collections and subsites using a Custom User Action.  I want to use a CDN.  Governance will not let me add to the layouts folder on the WFE's.  Using a CDN for a CUA is causing the blank page.

Initial Hypothesis:  I don't want to deploy the same JS file hundreds of thousands of times into the local site collections.  As updating and storage are crazy.  I want a CDN like behaviour, and the closest I can get is to modify the hive directory on each SharePoint on-prem. farm that allows me to reference the JS.  I do have several farms and IT governance won't let me modify the WFE's.

Tobias Lekman has an excellent comprehensive overview of the CUA issue:
https://blog.lekman.com/2013/01/scriptlink-registration-in-sharepoint.html

Doing the usual testing, bizarrely I can use anonymous https://radimaging.sharepoint.com/_layouts/15/guestaccess.aspx?docid=55529eccf4555d698555cb26108fb555&authkey=555-6M9555zF555g555 for my CUA JS file.
When I allow external access on my personal public O365 E3 tenant, I can use this URL, the CUA works perfectly.  My client does not have an Office 365 external public tenant I can use, so an Akamai (or another CDN)CDN and fake the validation.  It's either SP URL validated, or I need to load it differently if I want to use a CDN.  I used an Akamai CDN and added /_layouts/15/ into the URL using folders, and the CDN started working for my CUA. e.g. https://cdn.domain.com/sharepoint/_layouts/15/cuatest.js

Possible Resolution:
  1. Local Site Collection uploaded files
  2. CDN assuming the JS location has: 

Saturday 30 September 2017

Integrating Skype into a SPA in SharePoint

SPA are pretty common and recently on a project I had a request to show contacts with a SPA hosted on SharePoint.  Here is code that shall show Skype presence to the user.

Note: Works on IE, requires the user to be logged into Skype and have the Skype client.

<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=10" />
    <title> Presence with Skype </title>
    <link rel="stylesheet" type="text/css" href="/_layouts/15/1033/styles/Themable/corev15.css" />
    <script type="text/javascript" src="/_layouts/15/init.js"></script>
    <script type="text/javascript" src="/_layouts/15/1033/strings.js"></script>
    <script type="text/javascript" src="/_layouts/15/core.js"></script>
</head>
<body>
    <script type="text/javascript">
        var g_presenceEnabled = true;
    </script>
    <div>
        ​ <span class="ms-verticalAlignTop ms-noWrap ms-displayInlineBlock">
            <span class="ms-imnSpan">
                <a class="ms-imnlink ms-spimn-presenceLink" aria-hidden="true" onclick="IMNImageOnClick(event);return false;" href="#">
                    <span class="ms-spimn-presenceWrapper ms-imnImg ms-spimn-imgSize-10x10">
                        <img name="imnmark" class="ms-spimn-img ms-spimn-presence-online-10x10x32" id="imn_1,type=smtp" alt="Offline" src="/_layouts/15/images/spimn.png" sip="pb@radimaging.co.uk" showofflinepawn="1" />
                    </span>
                </a>
            </span>
            <span class="ms-noWrap ms-imnSpan">
                Paul beck
            </span>
        </span>
    </div>
</body>

</html>

Sunday 10 September 2017

Custom User Actions: Injecting JavaScript

Problem: Changing Master pages is not good for support and can cause your applications to break when updates are done.

Possible Resolution:  Inject JavaScript to perform custom logic and branding using Custom User Actions.  This allows you to inject JavaScript at the appropriate level and not change any OOTB pages or user controls.  Custom User actions can be applied at 3 levels in a Site collection namely at:
  1. Site Collection Level (always fired),
  2. SPWeb Level or at the
  3. List (Document library) level.
More Information:
Tool to try and add Custom User Action looks useful:
https://spusercustomactionmanageronline.codeplex.com/
https://msdn.microsoft.com/en-us/pnp_articles/customize-your-sharepoint-site-ui-by-using-javascript

Sunday 13 August 2017

SQL 2016 thoughts - 5 reasons to consider it

A couple of good reasons to use SQL 2016:

  1. Temporal Tables - Use instead of Tomb tables/highlander tables.
  2. Row Level Security - specify access to a row for users and groups
  3. Always encrypted - encrypts data at rest on a column (don't confuse with column level encryption)
  4. Read data from queries in JSON object format - nice
  5. Performance - The jump to using SQL 2016 is massive.  I've even heard people recon double the performance on the same kit as SQL 2012.  Multiple Temp DB tables is a big part of this.  And ultimately the best reason.

Sunday 6 August 2017

Common KQL Search Helper


Overview: I am forever forgetting the intricacies of using search and this post is a short note for common searches I use.  Ensure the search is working against "Everything":

Find items under a specific url (Path)
path:https://www.radimaging.com/sites/*

To only see team site (webtemplate)
webtemplate:STS

To see Content Types e.g. task list items
spcontenttype:Task

Example used in a search box for using a wildcard on the title
ClientSector:Finance AND Title:*Paul*

You can use the query approach for any Managed property to refine your search.  Example:
http://radimaging.net/sites/healthcare/_api/search/query?querytext='ClientSector:Finance*'&startrow=2&rowlimit=500

ClientSector is a Managed Property (property bag) at the root site collection level of each site collection.
startrow is telling my query to skip the first 2 results
rowlimit is telling the search to return up to 500 results (max is 500, default is 50 if not specified).

Similar querying can be done using the search results page in the browser:
https://radimaging.net/Pages/results.aspx#k=ClientSector%3AFinance*#s=105
Client Sector MP search equivalant in the browser
s = startrow

It is a good idea to have a query tool (SharePoint Search Query Tool V2.7) to help build up queries and validate query logic.  I have built consoles to do this in CSOM in the past or used PowerShell with CSOM which is pretty good.
https://github.com/SharePoint/PnP-Tools/tree/master/Solutions/SharePoint.Search.QueryTool (PNP Tools GitHub)  as of 10 Dec 2018 version 2.8.2 is the latest version.

Examples:
querytext='SharePoi*'
querytext='ManagedPropertyCreated:Test*'&startrow=10&rowlimit=500&sortlist='created:descending'&clienttype='ContentSearchRegular'


Read More:
https://gallery.technet.microsoft.com/office/Query-SharePoint-2013-373ff97a
http://nikcharlebois.com/get-search-results-in-sharepoint-2013-using-powershell/


Sunday 30 July 2017

Tech Megatrends in 2017 - The bigger Picture

Problem: What are the major technology changes that are going to shape the enterprise over the next 5-10 years? 

Initial Hypothesis: Working within technology and making businesses more competitive I see the speed at which technology changes.  Working with multiple large customers, I know that people are generally looking at a handful of strategic technology trends.  While technology trends are actually all connected and a hierarchy.  Basically, I am classifying the significant tech trends and not drilling down to lower levels such as Mobile application patterns or particularly technologies such as O365.

While technologies are not so kind as to make themselves easy to segregate I feel the big trends are:

Analytics - Storage, mining, analyzing data and reporting.  Basically, this is an old industry with new trends such as larger data sets, new data sets e.g. social media, additional reporting formats/media, AI is really trended recognition on steroids.  The trend has been to make analytics available closer to real time and not it's moving into predictive.  Robotics is a closely related working with data. 

Security - We have so much more data and devices, the old world of protecting your own assets and monitoring outside people in a regulated fashion is no longer the main way of securing.  Key is understanding that identity is king.  Be this an individual or a computer; we need to be able to know the person or system are whom they say they are (non-repudiation).  Block-chain - While I think it's important and in some industries absolutely critical, this to me falls under security.  We need to trust and share between machines and transactions. Once again an old industry with a shift in focus in that identity and collaboration is now central to security and not using a centralized castle like security models.

Cloud Computing - Low-cost computing paid for on demand is simply a continuing trend for businesses, only now we are good at virtualization and cloud computing and the big three (AWS, Azure & Google) are getting better quickly.  Cloud computing ties to Analytics and security. Virtualization has progressed and we are getting better at providing computing safely and at a lower cost.

Sub Trends:

Robotics/Automation - Automation goes manual steps on behalf of a human and historically this has been more around manufacturing.  Going forward I see it taking over rudimentary information worker roles.  Ingesting legislative data is a great example and coupled with machine learning, we can build up models to identify what laws are applicable in different jurisdictions. Medical diagnosis are often referred to under AI is not intelligence, it's pattern recognition and analytics to determine a likely problem from the data picked up and cleaned.  The medical example will be essential to us thriving on this planet; doctors will only get complex issues, the rudimentary stuff will disappear and be dealt with better meaning fewer returning patients.

IOT - not exactly new just we have to do it better on a larger scale.  So while technology is changing, systems communication is not.  I see drones more as a subset of IOT, hardware devices using analytics.  Pretty similar to fully automated self-driving cars.

Augment Reality (AR)/Virtual Reality - will be big but like block chain will have unique application is different industries.  It relies on Analytics and security as its underpinning.

Here is some research I gleaned from 5 key firms on current technology mega-trends (this is how I see these firms views on the tech mega trends,):

PWC
===
Artifical Intelligence (AI)
Augment Reality (AR)
Blockchain
Drones (UAV)
IOT
Robotics
Virtual Reality
3D printing

EY
===
Artificial Intelligence - Cognitive learning
Robotic Automation (RPA)
Blockchain
Analytics
Internet of Things (IOT)
Cybersecurity

Deloitte
=======
Dark Analytics
Machine Intelligence
Mixed Reality
Inevitable architecture (cloud computing)
Everything as a service (cloud computing)
Blockchain

KPMG
====
Big Data & analytics/AI
Cloud Computing
Cryptocurrency/Digital Payments
IOT
Robotics
CyberSecurity
Virtual and augmented reality - stock and glasses -Google glasses

McKinsey
=======
AI
Analytics
Robotics

Possible Resolution:  Most people in technology are aware of the mega trends, how relatively important each trend is and the details of how quickly change is happening.  For me analytics, speed to market and trust need to underpin everything I deliver.