Friday 6 November 2015

Setup and Start the SharePoint 2013 User Profile Service (UPS)

Setup and Start the SharePoint 2013 User Profile Service (UPS)

Start the User Profile Service:

  1. Open "Central Administration"
  2. Login as the SharePoint Install account
    This account must have dbcreate and securityadmin server roles on the SQL Server  {SQL Server 2012 Name}
  3. Click “Manage services on server”, under “System Settings”
     photo UPS9.jpg
  4. Find "User Profile Service" 
  5. Click "Start", on the right 
     photo UPS17.jpg

Create the User Profile Service (UPS) Application:

  1. Open "Central Administration"
  2. Click “Manage service applications”, under “Application Management”
     photo Picture1-2.jpg
  3. Click "New"
     photo UPS2.jpg
  4. Select "User Profile Service Application"
     photo UPS3.jpg
  5. Fill in the related fields
    (If I haven't mentioned the field, it has the default settings)

    a.  Name:  User Profile Service
    b.  Application Pool:  Use existing application pool:  Shared Services
     photo UPS51.jpg

    c.  Profile Database:
         i.  Database Server:  {SQL Server 2012 Name}
         ii. Database Name:  {Database}_UserProfile
     photo UPS52.jpg

    d.  Synchronization Database:
         i.  Database Server:  {SQL Server 2012 Name}
         ii. Database Name:  {Database}_UserProfile_Sync
     photo UPS53.jpg

    e.  Social Tagging Database:
         i.  Database Server:  {SQL Server 2012 Name}
         ii. Database Name:   {Database}_UserProfile_Social  
     photo UPS54.jpg

    f.  Profile Synchronization Instance: {SharePoint Server Name} (default - current server)
     photo UPS55.jpg
    f.  My Sites. If you don't have, in this example we done, you can leave it blank, as default.
     photo UPS56.jpg
  6. Click "Create"
     photo UPS6.jpg
  7. Click "OK"
  8. See full here: User Profile Service Application Settings

Start the User Profile Synchronization Service:

Make sure the SPFarm account has local admin access to the SharePoint Server the UPS synchronisation will be running on. This then needs to be removed once the synchronisation is complete.
  1. Open "Central Administration"
  2. Click “Manage services on server”, under “System Settings”
     photo UPS9.jpg
  3. Find "User Profile Synchronization Service"
  4. Click "Start", on the right
     photo UPS8.jpg
  5. Fill in the Share Point Farm account
     photo UPS10.jpg
  6. Click "OK" 

Reset the IIS:

  1. Open "Command Prompt", as Administrator
  2. Type and enter:  iisreset
     photo UPS7.jpg
  3. Close "Command Prompt"

Create the Profile Synchronization Connection:

  1. Open "Central Administration"
  2. Click “Manage service applications”, under “Application Management”
     photo Picture1-2.jpg
  3. Find and Select "User Profile Service"
     photo UPS11.jpg
  4. Click "Configure Synchronization Connection", under Synchronization
     photo UPS12.jpg
  5. Click "Create New Connection"
     photo UPS14.jpg
  6. Fill in the related fields
    (If I haven't mentioned the field, i have left in the default settings.)

    a.  Connection Name:  User Profile Synchronisation
    b.  Forest name:  {DomainName.com} or {DomainName.local}
    c.  Account Name:  Share Point UPSync account
        This account must have "Directory replication rights" in AD (active directory)
    d.  Click "Populate Container"
     photo UPS15.jpg
    e.  Select the User Accounts you want to add
    f.  Click "OK"

Start the Profile Synchronization for the first time:

  1. Open "Central Administration"
  2. Click “Manage service applications”, under “Application Management”
     photo Picture1-2.jpg
  3. Find and Select "User Profile Service"
     photo UPS11.jpg
  4. Click "Start Profile Synchronization", under Synchronization
     photo UPS13.jpg
  5. Select "Start Full Synchronization"
     photo UPS16.jpg
  6. Click "OK"
    This will take a few minuets     
  7. Source from http://jaxsharepoint.blogspot.in/2013/08/setup-and-start-sharepoint-2013-user.html

Monday 2 November 2015

Configureing FOr APPS

Microsoft is calling everything as an app in SharePoint 2013, what I mean by everything ... Artifacts in SharePoint such as List, libraries etc.
When you develop apps as solution packages using visual studio, these apps will get installed in a separate domain so that the performance of the server will not get impacted.
One of way of deploying apps is SharePoint hosted model in this app can't have custom code, this is another way of securing the server from improper solutions that use to get deployed in SharePoint environment.
This is only a very little introduction of Apps in SharePoint, I will discuss more on how to develop Apps on SharePoint 2013 using visual studio under the tutorials section of this website.
Let's move to configure Apps.

Install and Configure Apps:

In this post you will learn how to Install and configure Apps on SharePoint 2013. Just simply follow me I will guide you through the steps which you need to perform.
To Install and configure Apps on SharePoint 2013, you have to perform below three steps.
  1. Set up DNS for App domain.
  2. Create the App management and Subscription Settings service application.
  3. Configure SharePoint to use App domain.
Please follow the below steps and you can successfully configure the apps in SharePoint 2013.

Step1: Setup DNS for App domain:

To set up DNS go to Administrative tool and select DNS.

DNS
All Apps on SharePoint have unique URL domain names, so before we’re done, we need to set up a wildcard alias.
A wildcard alias basically mean you can add anything in front of the domain name and point it to a specific address.
In the DNS manager select for your domain and right click select “New Alias”.

DNS Manager
In the New Resource Record dialog box, enter an asterisk (*) as the Alias name, and then either browse to the record for your server or type in the DNS-name of your server. See the below screenshot.

DNS Manager
Click ok and then ok.
DNS Manager

Step2: Create the App Management and Subscription Setting Service Applications:

You have to add two services which are required to Install and Configure Apps on SharePoint 2013.
  1. App Management Service
  2. Microsoft SharePoint foundation Subscription Settings Service
Run the below powershell commands to start the services.
Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"} | Start-SPServiceInstance.
Before running powershell scripts use “Start-Transcript”, so that you can track all the commands you are executing in SharePoint 2013 management shell.

Start-SPServiceInstance
After executing the powershell commands please check whether the services are running on the machine from the central administration screen.
Go to central admin, under Application management and select manage services on the server.

Servers in Farm
Once you came to know that App management and Subscription Settings services are running, you have to configure respective service applications.
To configure please follow the below steps.
To perform the below steps I am using the farm admin account here, but if you have any Specific account running this service You can use that account.
$account = Get-SPManagedAccount “ sp\administrator”.
1. AppManagementService
$appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account.
2. SPSubscriptionSettingsService
$appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account.
3. Creating AppManagementService Service Application
$appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName Appmanagement_Service_DB.
4. Creating Proxy for AppManagementService service application
$proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc.
5. Creating SubscriptionSettingsService Service Application
$appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName SubscriptionSettings_Service_DB.
6. Creating Proxy for SubscriptionSettingsService service application
$proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc.
You can check the Application services and databases created after running above powershell commands.

Please check the below screenshots.

Service Applications
Service Application Databases

Step 3: Configuring SharePoint to use App domain:

To configure the Apps for SharePoint. Go to an Apps section in Central admin.

Apps-Central admin
Click on Configure Apps URLs and then enter the App domain you set up. In my example I am using same domain where my SharePoint running.
In addition, you need to decide on an App prefix that all App DNS names will get. Anything will do if you follow the description of Characters allowed.
For each instance of an App you install and activate, SharePoint creates a unique URL to access the App. The unique URL starts with the prefix you choose followed by a unique identifier set by SharePoint and Finally the App domain you have created.

Configure App URLs
Configure App URLs
Click ok.
We are one step away to use Apps and the SharePoint Store.
For that we need to create an App catalog site collection to hold our Apps. When you add an App by uploading an App package, this is where you will do that.
From the Apps section of Central Administration, select Manage App Catalog. Leave the Create a new app catalog site choice selected and hit OK to advance to the Create App Catalog step.
Manage App Catalog
SharePoint App Catalog
Enter the Title, website address and primary site collection administrator details. It is similar like creation of site collection. Once it got created it will be redirected to “Manage App Catalog” section.
You can see in the below screens App catalog has been created.
Manage App Catalog
Click on the site URL to access the App catalog.
SharePoint App Catalog
Congratulations you have successfully configured the Apps for SharePoint 2013.
In the above screenshot you can see “App requests”,”Apps for office” and “Apps for SharePoint” section.

Content From:http://www.sharepoint-journey.com/app-management-sharepoint-2013.html

Friday 16 October 2015

Adding paging numbers to the control list with paging template

When you are using the Content Search Web Part, you have by default a control template list with paging available. Now this template only shows left and right buttons to navigate to the next or previous page:
Default list with paging template
Default list with paging template
These two buttons do not give you very much visual information about paging. For example: you do not know on which page you currently are and you can only go back one page at a time.
If you go to a SharePoint search center the paging works a bit differently compared to the CSWP template. In the default control template of the search result web part the same left and right paging buttons are included, but you also have page numbers which makes it easier to navigate.
Search result web part template with paging
Search result web part template with paging
As this is just some additional JavaScript it can be easily added to your own templates so that you can create a control template with paging numbers for the CSWP.

Solution

The code you need to add to get these paging numbers in your control template is the following:

The code loops over all the available pages. You need to be aware that there are two special numbers that you can retrieve which is:
  • "-1": move to the previous page
  • "-2": move to the next page
Special page numbers
Special page numbers
These special numbers are used for the left and right buttons, so they do not need to be included in the paging numbers. That is why there is a check to see if the pageNumber is not equal to -1 or -2.
This code needs to be added in between the left and right buttons:


Result

This is the end result:List with paging buttons and numbers
List with paging buttons and numbers





COpy the COde:


<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"> 
<head>
<title>List with Paging Numbers</title>

<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:TemplateHidden msdt:dt="string">0</mso:TemplateHidden>
<mso:MasterPageDescription msdt:dt="string">This is a Control Display Template with Paging. It is used by default in Rollup Pages. It allows the user to page through items using the arrows that appear when there are more items to show.</mso:MasterPageDescription>
<mso:ContentTypeId msdt:dt="string">0x0101002039C03B61C64EC4A04F5361F385106601</mso:ContentTypeId>
<mso:TargetControlType msdt:dt="string">;#Content Web Parts;#</mso:TargetControlType>
<mso:HtmlDesignAssociated msdt:dt="string">1</mso:HtmlDesignAssociated>
<mso:HtmlDesignConversionSucceeded msdt:dt="string">True</mso:HtmlDesignConversionSucceeded>
<mso:HtmlDesignStatusAndPreview msdt:dt="string">http://intranet/sites/SPSUK/_catalogs/masterpage/tests/Control_ListWithPagingNumbers.html, Conversion successful.</mso:HtmlDesignStatusAndPreview>
</mso:CustomDocumentProperties>
</xml><![endif]-->
</head>

<body>
    <div id="Control_ListWithPaging">

<!--#_ 
if (!$isNull(ctx.ClientControl) && !$isNull(ctx.ClientControl.shouldRenderControl) && !ctx.ClientControl.shouldRenderControl()) {
    return "";
}
ctx.ListDataJSONGroupsKey = "ResultTables";
var $noResults = Srch.ContentBySearch.getControlTemplateEncodedNoResultsMessage(ctx.ClientControl);

var isRollupPageInDisplayMode = Srch.ContentBySearch.isRollupPage(ctx.ClientControl) && !Srch.U.isPageInEditMode();
var noResultsClassName = isRollupPageInDisplayMode ? "ms-attractMode ms-uppercase ms-alignCenter" : "ms-srch-result-noResults";

var ListRenderRenderWrapper = function(itemRenderResult, inCtx, tpl) {
    var iStr = [];
    iStr.push('<li>');
    iStr.push(itemRenderResult);
    iStr.push('</li>');
    return iStr.join('');
}
ctx['ItemRenderWrapper'] = ListRenderRenderWrapper;
_#-->
    <ul class="cbs-List">

<!--#_
var showPaging = ctx.ClientControl.get_showPaging();
if(showPaging) {
    var pagingInfo = ctx.ClientControl.get_pagingInfo();
    if(!$isEmptyArray(pagingInfo)) {
        var getPagingImageClassName = function(buttonClassNamePrefix, isNext, isEnabled) {
            var className = buttonClassNamePrefix;
            className += (isNext && !Srch.U.isRTL()) || (!isNext && Srch.U.isRTL()) ? "right" : "left";
            if(!$isNull(isEnabled) && isEnabled == false) {
                className += "-disabled";
            }
            return className;
        }

        var getPagingContainerClassName = function(buttonClassNamePrefix, isEnabled) {
            var className = buttonClassNamePrefix;
            className += isEnabled ? "enabled" : "disabled";
            return className;
        }

        var firstPage = pagingInfo[0];
        var lastPage = pagingInfo[pagingInfo.length - 1];
        var hasNextPage = lastPage.pageNumber == -2;
        var hasPreviousPage = firstPage.pageNumber == -1;
        var buttonClassNamePrefix = "ms-promlink-button-";
        var nextPageContainerClassName = getPagingContainerClassName(buttonClassNamePrefix, hasNextPage);
        var previousPageContainerClassName = getPagingContainerClassName(buttonClassNamePrefix, hasPreviousPage);
        var nextPageImageClassName = getPagingImageClassName(buttonClassNamePrefix, true, hasNextPage);
        var previousPageImageClassName = getPagingImageClassName(buttonClassNamePrefix, false, hasPreviousPage);
_#-->
        <li class="ms-promlink-header">
            <span class="ms-promlink-headerNav">
                <a class="ms-commandLink ms-promlink-button _#= $htmlEncode(previousPageContainerClassName) =#_" title="_#= $htmlEncode(firstPage.title) =#_" href="#" onclick='$getClientControl(this).page(_#= $htmlEncode(firstPage.startItem) =#_);return Srch.U.cancelEvent(event);'>
                    <span class="ms-promlink-button-image">
                        <img class="_#= $htmlEncode(previousPageImageClassName) =#_" alt="_#= $htmlEncode(firstPage.title) =#_" src="_#= $urlHtmlEncode(GetThemedImageUrl('spcommon.png')) =#_">
                    </span>
                </a>

                <span class="ms-promlink-button-inner"></span>

<!--#_
        // Show the paging numbers
        for (var i = 0; i < pagingInfo.length; i++) {
            var pi = pagingInfo[i];
            if(!$isNull(pi)) {
                if (pi.pageNumber !== -1 && pi.pageNumber !== -2) {
                    var pageLinkId = "PageLink_" + pi.pageNumber;
                    // Check if it is the current selected page
                    if (pi.startItem === -1) {
_#-->
                    <strong>_#= $htmlEncode(pi.pageNumber) =#_</strong>
<!--#_
                    } else {
_#-->
                    <a id="_#= $htmlEncode(pageLinkId) =#_" href="#" title="_#= $htmlEncode(pi.title) =#_" onclick="$getClientControl(this).page(_#= $htmlEncode(pi.startItem) =#_);return Srch.U.cancelEvent(event);">_#= $htmlEncode(pi.pageNumber) =#_</a>
<!--#_
                    }
                }
            }
        }
_#-->

                <span class="ms-promlink-button-inner"></span>

                <a class="ms-commandLink ms-promlink-button _#= $htmlEncode(nextPageContainerClassName) =#_" title="_#= $htmlEncode(lastPage.title) =#_" href="#" onclick='$getClientControl(this).page(_#= $htmlEncode(lastPage.startItem) =#_);return Srch.U.cancelEvent(event);'>
                    <span class="ms-promlink-button-image">
                        <img class="_#= $htmlEncode(nextPageImageClassName) =#_" alt="_#= $htmlEncode(lastPage.title) =#_" src="_#= $urlHtmlEncode(GetThemedImageUrl('spcommon.png')) =#_">
                    </span>
                </a>
            </span>
        </li>
<!--#_
    }
}
_#-->

            _#= ctx.RenderGroups(ctx) =#_
        </ul>
<!--#_
if (ctx.ClientControl.get_shouldShowNoResultMessage()) {
_#-->
        <div class="_#= noResultsClassName =#_">_#= $noResults =#_</div>
<!--#_
}
_#-->

    </div>
</body>
</html>