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

Tuesday, May 24, 2016

Office Graph implementation with SharePoint Online Search REST APIs

Graph Query Language (GQL) is a preliminary query language designed to query the Office Graph via the SharePoint Online Search REST API. By using GQL, we can query the Office Graph to get items for an actor that satisfies a particular filter.The Office Graph contains information about enterprise objects, such as people and documents, as well as the relationships and interactions among these objects. The relationships and interactions are represented as edges.Some edges represent a single interaction:
  • Modified — User A modified a document.
  • Viewed — User B viewed a presentation.
Some edges are computed based on multiple interactions:
  • WorkingWith — People whom you frequently interact with.
  • TrendingAround — Items that are popular in your circle of colleagues.

The Office Graph data model and edge properties

As with any graph, each edge in the Office Graph has a source node and a target node. The source node is called the actor and the target node is called the object.

Figure 1. 

The relationship among actor, edge, and object

A typical graph query call via REST

A graph query can contain both a content part (Querytext) and a graph part (GraphQuery). We can use these to do a combined search on the contents of a whole item and the interactions people have had with this particular item. The Querytext property is mandatory. If we want to match all items without filtering any part of the content, you can use an asterisk (*).

GQL has one main operator: ACTOR. The ACTOR operator finds all actions of the given actor that satisfies a filter and then returns all the objects for these actions. For example, to return Items viewed by the actor in the last three months. (Assuming the ActorId = 12345 for User A) you can split this information into: User A is the ACTOR. View is the action with ID = 1001. Document is the object, which is returned in the result.Then, you can write the following query.ACTOR(ME, action:1001)The following is the syntax for the ACTOR operator.ACTOR(<ActorId> [, filter])

Example 1: View all items created by userExample 2: People whom the actor communicates with or works with frequently.  You can sort the result returned for graph queries in two ways: by the edge's Timestamp or the edge's Weight.
  • To sort based on the edge timestamp, set the GraphRankingModel property equal to {"features"\:[{"function"\:"EdgeTime"}]}.
  • To sort based on the edge weight, set the GraphRankingModel property equal to {"features"\:[{"function"\:"EdgeWeight"}]}.

In both cases, you must also set the RankingModelId property to '0c77ded8-c3ef-466d-929d-905670ea1d72'. If an item in the result is the object of more than one edge matching the graph query, the highest Timestamp or Weight is used.

Table 1. Edge property descriptions and their types

Property Type Description
ActorId Integer The ID of the actor.
ObjectId Integer The ID of the object.
Action type Integer An ID that identifies what action or relationship type the edge represents. Important action types are listed in Available action types.
Time String A timestamp of the edge; based on the ISO 8601 standard. The semantics of the time stamp depend on the type of the edge. See Available action types.
Weight Integer A number that indicates the importance of the edge. The semantics of the weight depend on the type of the edge. See Available action types.
Blob Blob For internal use only.
BlobContent String For internal use only.
ObjectSource Integer For internal use only.

Table 2. Action types and their descriptions

Action Type Description Visibility ID Weight Timestamp
PersonalFeed The actor's personal feed as shown on their Home view in Delve. Private 1021 A sequence number. When the item was added to the feed on the Home view in Delve.
Modified Items that the actor has modified in the last three months. Public 1003 The number of modifications. Last modified.
OrgColleague Everyone who reports to the same manager as the actor. Public 1015 Always 1. -
OrgDirect The actor's direct reports. Public 1014 Always 1. -
OrgManager The person whom the actor reports to. Public 1013 Always 1. -
OrgSkipLevelManager The actor's skip-level manager. Public 1016 Always 1. -
WorkingWith People whom the actor communicates with or works with frequently. Private 1019 A relevance score. -
TrendingAround Items popular with people whom the actor works with or communicates with frequently. Public 1020 A relevance score. -
Viewed Items viewed by the actor in the last three months. Private 1001 The number of views. Last viewed.
WorkingWithPublic A public version of theWorkingWith edge. Public 1033 A sequence number. -

Table 3. Result sources for SharePoint query

Result Source ID
Documents e7ec8cee-ded8-43c9-beb5-436b54b31e84
Items matching a content type 5dc9f503-801e-4ced-8a2c-5d1237132419
Items matching a tag e1327b9c-2b8c-4b23-99c9-3730cb29c3f7
Items related to current user 48fec42e-4a92-48ce-8363-c2703a40e67d
Items with same keyword as this item 5c069288-1d17-454a-8ac6-9c642a065f48
Local People Results b09a7990-05ea-4af9-81ef-edfab16c4e31
Local Reports And Data Results 203fba36-2763-4060-9931-911ac8c0583b
Local SharePoint Results 8413cd39-2156-4e00-b54d-11efd9abdb89
Local Video Results 78b793ce-7956-4669-aa3b-451fc5defebf
Pages 5e34578e-4d08-4edc-8bf3-002acf3cdbcc
Pictures 38403c8c-3975-41a8-826e-717f2d41568a
Popular 97c71db1-58ce-4891-8b64-585bc2326c12
Recently changed items ba63bbae-fa9c-42c0-b027-9a878f16557c
Recommended Items ec675252-14fa-4fbe-84dd-8d098ed74181
Wiki 9479bf85-e257-4318-b5a8-81a180f5faa1

References:Query the Office Graph using GQL and SharePoint Online Search REST APIsSharePoint Search REST API overview

Wednesday, May 14, 2014

Install and configure SharePoint 2013 Service Pack 1



The purpose of this document is to describe step by steps instructions that must be followed to consistently perform the installation and configuration of SharePoint Server 2013 SP1.


This includes the supporting servers and the servers that will have SharePoint 2013 installed. The following servers must be configured to support and host a farm:
·         Database server: The required version of SQL Server is SQL server 2012 enterprise version, including service pack 1 and cumulative updates must be installed during installation on the database server. The installation must include all features and administrative tools and packages. For additional information and guidance , see:

The data location should be set up on drive D or E as required.
·         Application servers and front-end Web servers: The farm servers that will have SharePoint 2013 installed must be prepared as follows: verify that they meet the hardware requirements, have the operating system updates. For additional information and guidance , see:
o    "Installing software prerequisites" in Hardware and software requirements for SharePoint 2013

Product Overview

SharePoint Server 2013 provides a comprehensive solution for connected information work that enables people to transform the way they work while preserving the benefits of structured processes, compliance, and existing IT investments.
SharePoint Server 2013 has been optimized for the way people work, providing people with a familiar, consistent view of information, collaboration, and process, and IT with a comprehensive, easily-managed and integrated platform to meet the needs of the business.

Product Inventory

Product Name
Windows Server 2012 R2
SharePoint 2013 Service Pack 1
SQL Server 2012 Service Pack 1
.Net Framework
3.5 and 4.5 (as part of windows installation)
Additional language packs may be downloaded and installed for SharePoint 2013.

User and Groups

Following service accounts are to be created in active directory with required complexity and password never expire. 

Account name
Account Description
This is Service account for User Profile synchronization
This is service account for Search service applications
This is service account for execute all SCA jobs
This is service account for Farm Configuration
This is Service account for Search content access
This is Service account for Web application pool account
This is Service account for all SharePoint service applications
This is service account for all interfaces
This is Service account for setup and owner of site collection

Turn off UAC settings for service accounts

·           Open User Account Control Settings by clicking the Start button Picture of the Start button, and then clicking Control Panel. In the search box, type UAC, and then click Change User Account Control settings.

·           To turn off UAC, move the slider to the Never notify position, and then click OK.  Administrator permission required if you're prompted for an administrator password or confirmation, type the password or provide confirmation. You will need to restart your computer for UAC to be turned off.

UAC settings should be turned off by installation script.

Add services accounts to local administrator

Service accounts to be added, FarmSVC and SetupSVC.

Open Server Manager. Click Tool in the right corner of Server Manager and then select Computer Management.

In the Computer Management windows, expand Local Users and Groups and select Groups. Double click on Administrators group.

In the Administrators Properties, click Add...In the Select Users, Computers, Service Accounts, or Groups windows, type the account you want to add to Local Administrator group and then click OK.

Click OK.

Add service accounts to SQL users and grant permissions

·         Add FarmSVC and SetupSVC service accounts to SQL using this technet article.
·         Grant dbcreator and securityadmin.
Note :- SQL should be installed with setup account.

 Installation and Configuration of SharePoint Server 2013

Prerequisites for Installation and Configuration

Before you begin to install and configure SharePoint 2013, do the following:

Ensure that you have met all hardware and software requirements. You must have a 64-bit version of Windows Server 2012 R2 SP1. For server farms, you must also have a supported 64-bit version of SQL Server. For more information about these requirements, such as specific updates that you must install, see Hardware and software requirements for SharePoint 2013.

Ensure that you perform a clean installation of SharePoint 2013.

Ensure that you are prepared to set up the required accounts by using appropriate permissions. For detailed information, see Initial deployment administrative and service accounts in SharePoint 2013.

Install Window server 2012 R2 Roles/Features

This script installs all of the necessary Windows Server 2012 R2 Roles/Features to prepare for a SharePoint 2013 installation. This script supports installing the Roles/Features 'Online' with an Internet connection and 'Offline' without an Internet connection, using Windows server 2012 media.

 Windows Server 2012 R2 Environment Assumptions:

This script assumes (and does not check) that the following Windows Server 2012 R2 Features are installed (they should installed be by default in Windows Server 2012 R2):
·                     .NET Framework 4.5 Features (NET-Framework-45-Features)
·                     .NET Framework 4.5 Features > .NET Framework 4.5 (NET-Framework-45-Core)
·                     Windows PowerShell (PowerShellRoot)-Windows PowerShell > Windows PowerShell 3.0 (PowerShell)

Are you installing the Roles/Features 'Online' or 'Offline'?

·           If your server is 'Online' and you use the PrerequisiteInstaller.exe (i.e. out of the box), it will execute a PowerShell script to install the necessary Roles/Features to configure Windows Server 2012 R2 for SharePoint 2013. Part of the (PowerShell) Add-WindowsFeature installation installs the NET-Framework-Core feature which is .NET 3.5. This installation requires binaries and other files that are not included by default in Windows Server 2012 R2. This requires Windows Update to download/install these files and an Internet connection.
·           You need to have SharePoint 2013 SP1 media to run preinstaller.exe to configure web and app roles for windows server 2012 R2.
·         Download .zip file containing my scripts and extract the .ps1 files to c:\powershellscripts (or another directory of your choosing)
·         Run PowerShell as Administrator (you can do this from the Start Screen - right click PowerShell and select "Run as Administrator"
·         Ensure you have set your PowerShell execution policy to Remote-Signed (you can change it later if you need to)
·         Run this script: 
o   When you run the script, it will prompt you to decide if you are installing the Roles/Features 'Online' or 'Offline'. If you select 'Online' your server must have an Internet Connection. In this case, Windows Update will be used to download then install binaries and other files related to the installation of .NET 3.5. If you select 'Offline', the script will prompt you for the location of your Windows Server 2012 R2 installation media. The binaries and other files required are included in this media. Enter the path (without a trailing slash) to the 'sources\sxs' folder (for example D:\sources\sxs) of your Windows Server 2012 R2 installation media. This can be a mounted ISO, a local drive or a UNC path. Using the 'Offline' method will install the Roles/Features faster than the 'Online' method. 
o   The script will prompt you to Reboot your server after the Roles/Features have installed. You can opt in or out, but I recommend that you opt in and reboot your server as you need to in order for the Windows Features to be configured correctly.

Download SharePoint 2013 prerequisites

This script downloads the ENGLISH versions of the required Prerequisite files for SharePoint 2013 on Windows Server 2012 R2. It stores them in a directory of your choosing.

·      Create a local directory where the script can save the SharePoint 2013 Pre-requisite downloads. For example, c:\sp2013downloads.
·      Run PowerShell as Administrator (you can do this from the Start Screen - right click PowerShell and select "Run as Administrator"
·      Run this script: 
·      You will be required to define a path where the script can save the downloaded files. (e.g. c:\sp2013downloads)

Install SharePoint 2013 prerequisites

This script utilizes the PrerequisiteInstaller.exe included in the SharePoint 2013 installation media to install the necessary prerequisites for SharePoint 2013 on Windows Server 2012 R2.
You have downloaded the SharePoint 2013 installation media from MSDN, TechNet or Volume Licensing/Software Assurance etc.

·         You have already executed Install-SP2013RolesFeatures.ps1 and rebooted your server
·         You have already executed Download-SP2013PreReqFiles.ps1
·         Copy the SharePoint 2013 installation media files into a local directory on you Windows Server 2012 R2 server. For example, c:\sp2013.
·         Copy the Prerequisite files into the c:\sp2013\prerequisiteinstallerfiles directory.
·         Run PowerShell as Administrator (you can do this from the Start Screen - right click PowerShell and select "Run as Administrator"
·         Run this script:
·         You will be required to define a path where to your SharePoint 2013 installation media. (e.g. c:\sp2013). Watch the Prerequisite installer tool install all of the prerequisites.
·         When the installer is complete, reboot your server prior to installing SharePoint 2013. You should now be able to run the SharePoint 2013 installer, bypassing the Pre-requisite step.

Installation and Configuration Procedure

Steps to configure and run AutoSPInstaller, a set of scripts that can be used to automatically install SharePoint.

By not having the original file present, we ensure that our environment specific file is loaded and forms a way of documenting the installation. You could also provide separate config.xml files with separate PIDs. To do this, rename the config.xml files and specify the new names in the AutoSPInstallerInput.xml file under the ConfigFile element.

Open the file and enter the SharePoint 2013 product key under the PIDKEY parameter. Once done, open the files in Internet Explorer to ensure they open without errors, i.e. that they contain well formed XML. Alternatively, use an XML editor.

Create following folders

Enter passphrase for SharePoint farm

Ensure that the passphrase meets the following criteria:
  • Contains at least eight characters
  • Contains at least three of the following four character groups:
    • English uppercase characters (from A through Z)
    • English lowercase characters (from a through z)
    • Numerals (from 0 through 9)
    • Non-alphabetic characters (such as !, $, #, %)

Add service accounts under required parameters in the AutoSPInstallerInput.xml file.

Add SQL Database Name

You can also create default site collection with required host header

Update app domain URL

Save AutoSPInstallerInput.xml

Run AutoSPInstallerLaunch.

Post Installation Activities

Configure environment for apps for SharePoint

Verify following DNS entries

DNS Name

Add certificates to IIS

Add following certificate to IIS using this article.

Certificate Name

Configure central certificate store for IIS

The CCS is based on a truly simple concept. Store all the certificates in a Windows File Server share, then have the Web site bindings use those instead of locally installed certificates. Not only does this reduce the chaos of installing certificates on multiple servers, it greatly reduces the management time and effort locating certificates that are about to expire.
Refer MSDN Article to configure CCS.
Export all certificate listed above to this CCS.

 Add a Website to host SharePoint Apps on App server

This step tells you how to add a website to IIS by using the IIS Manager UI, or by running Appcmd.exe commands in a command-line window.

Open IIS Manager.

For Windows Server 2012 R2, on the Start page click the Server Manager tile, and then click OK. In the Server Manager, click the Tools menu, and then click Internet Information Services (IIS) Manager.

In the Connections pane, right-click the Sites node in the tree, and then click Add Website.

In the Add Website dialog box, enter name SCA SharePoint Apps for your website in the Site name box.

If you want to select a different application pool than the one listed in the Application Pool box, click Select. In the Select Application Pool dialog box, select an application pool from the Application Pool list and then click OK.

In the Physical path box, enter the physical path of the website's folder, or click the browse button (...) to navigate the file system to find the folder.

Select the protocol for the website from the Type list, Select HTTPS.

Enter a port number 443 in the Port text box.

Enter a host header name MySiteCollection for the website in the Host Header box.

If you do not have to make any changes to the site, and you want the website to be immediately available, select the Start Web site immediately check box.

Click OK.