Sunday, December 28, 2014

Tune your SharePoint Farm for better performance Part 3: Warm-Up your farm every morning

One of the best recommendations to improve performance in your farm is to run warm-up script every morning.

I recommand the script of  Jeff Jones  :  https://spbestwarmup.codeplex.com/


I use it every morning after resetting IIS, the script can also create a daily planified task in Task Scheduler.

See Also:

Tune your SharePoint Farm for better performance Part 2

Tune your SharePoint Farm for better performance Part 1





Wednesday, December 10, 2014

We're sorry. We ran into a problem completing your request. Please try that again in a few minutes

If you insert your Excel Web Access and then you choose the workbook from a trusted document library you may have this error:
We’re sorry. We ran into a problem completing your request. Please try that again in a few minutes.

to fix this issue


1.   Open Central administration
2.   Application management
3.   Manage web applications
4.   Select the web application where your site 
5.   Manage service connections
6.   Select the Excel Services Application

7.   Click OK


if your have already configured your Excel Services (ref: http://technet.microsoft.com/en-us/library/jj219698(v=office.15).aspx) Everything will be OK.

Enjoy...

Wednesday, December 3, 2014

How do I import active directory photos and sync them with my site collections?

Be sure that you have basic user profile synchronization working:


1- Import PictureUrl mapping: Go to your Central Admin site "Manage Service Applications --> User Profile Service Application --> Manager User Properties --> Picture" and select "thumbnailPhoto" as the attribute. Choose the "Import" direction". Be sure that the edit settings are "Do not allow users to edit values for this property" if you do not want photos from SharePoint Site to export to active directory. Click "OK".


2- Run a full profile sync: on the central admin site go to "Manage Service Applications -> User Profile Service -> Start profile synchronization" and select "Full".


3- Give your user permission to push photos to MySite : Go to Central Admin --> "Manage Service Applications". This time select the "User Profile Service Application" row and not the link. On the ribbon go to "Service Applications --> Sharing --> Permissions". Add your user account and give it "Full Control" permission.


4- Push the photos to MySite - This step requires that you have a MySite setup (Setup MySite). Open a powershell window and enter


Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation "http://YourServerName/my"


Enjoy...


Tuesday, December 2, 2014

Intergrate Yammer Embed - SharePoint Site - Javascript widgets

yammer
I used this code to Integrate the Yammer's company Feed into my SharePoint Site
Yammer

<script type="text/javascript" src="https://c64.assets-yammer.com/assets/platform_embed.js"></script>
    <div id="embedded-feed" style="height:400px;width:500px;"></div> 
    <script>
        yam.connect.embedFeed(
          { container: '#embedded-feed',
            network: 'mycampany.com'  // network permalink  
        });
    </script>

You can begin by testing a static example :

<!DOCTYPE HTML>
<html>
<head></head>
<body>
    <script type="text/javascript" src="https://c64.assets-yammer.com/assets/platform_embed.js"></script>
    <div id="embedded-feed" style="height:400px;width:500px;"></div> 
    <script>
        yam.connect.embedFeed(
          { container: '#embedded-feed',
            network: 'mycampany.com'  // network permalink  
        });
    </script>
</body>
</html>


see also :

Tuesday, May 13, 2014

Tune your SharePoint Farm for better performance Part 2: BLOB Cache and Remote BLOB Storage RBS


1- Enabling BLOB Cache:
To enable the BLOB cache you just need to modify some parameters in your web.config
find the the following line:
<BlobCache location="" path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)$" maxSize="10" enabled="false" />

change the enabled attribute, from "false" to "true".
choose the location by changing the location attribute example: location="D:\BlobCache"

2- Install and configure RBS in your SharePoint Farm:
-Enable FILESTREAM on the database server
By default, the FILESTREAM feature is installed when you install SQL Server 2008. But it is not enabled. You must enable and configure FILESTREAM on the computer that is running SQL Server 2008 that hosts the SharePoint 2013 databases. You must:
Enable FILESTREAM for file I/O streaming access.
Allow remote clients to have streaming access to FILESTREAM data.

follow these steps:

  • Go to SQL Server Configuration Manager and right-click SQL Server Services to open it.
  • Right-click on the instance of the SQL server on which you’re enabling FILESTREAM and select Properties.


  • Select the FILESTREAM tab and check the box to Enable FILESTREAM for Transact-SQL access.
  • Type the name of the Windows share.
  • Select Allow remote clients to have streaming access to FILESTREAM data, then select Apply.


  • Next, open the SQL Server Management Studio, then click on Query.
  • Type the following command in the Query editor (also shown in the image below). When completed, execute the command.
  • EXEC sp_configure filestream_access_level, 2
    RECONFIGURE
  • When the query completes, restart the SQL services.
Provision a BLOB store for each content database:
To provision a BLOB store

  1. Confirm that the user account performing these steps is a member of the db_owner fixed database role on each database that you are configuring RBS for.
  2. Click Start, click All Programs, click Microsoft SQL Server 2008, and then click SQL Server Management Studio.
  3. Connect to the instance of SQL Server that hosts the content database.
  4. Expand Databases.
  5. Click the content database for which you want to create a BLOB store, and then click New Query.
  6. Paste the following SQL queries in Query pane, and then execute them in the sequence listed. In each case, replace [WSS_Content] with the content database name, and replace c:\BlobStore with the volume\directory in which you want the BLOB store created. The provisioning process creates a folder in the location that you specify. Be aware that you can provision a BLOB store only one time. If you attempt to provision the same BLOB store multiple times, you'll receive an error.

use [WSS_Content]
if not exists 
(select * from sys.symmetric_keys 
where name = N'##MS_DatabaseMasterKey##')
create master key encryption by password = N'Admin Key Password !2#4'
use [WSS_Content]
if not exists 
(select groupname from sysfilegroups 
where groupname=N'RBSFilestreamProvider')
alter database [WSS_Content]
add filegroup RBSFilestreamProvider contains filestream
use [WSS_Content] 
alter database [WSS_Content]
 add file (name = RBSFilestreamFile, filename = 
'c:\Blobstore') 
to filegroup RBSFilestreamProvider
Install the RBS client library on each web server


To install the RBS client library on the on the first web server
Confirm that the user account performing these steps is a member of the Administrators group on the computer where you are installing the library.
On any web server, browse to http://go.microsoft.com/fwlink/p/?LinkId=271938 and download the RBS_amd64.msi file.
Click Start, click Run, type cmd into the Run text box, and then click OK.
Copy and paste the following command into the Command Prompt window. Replace WSS_Content with the database name, and replace DBInstanceName with the SQL Server instance name. You should run this command by using the specific database name and SQL Server instance name only one time. The action should finish within approximately one minute.


  • msiexec /qn /lvx* rbs_install_log.txt /i RBS_amd64.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="WSS_Content" DBINSTANCE="DBInstanceName" FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1
    
  • To install the RBS client library on all additional web and application servers
    Confirm that the user account performing these steps is a member of the Administrators group on the computer where you are installing the library.
    On any web server, browse to http://go.microsoft.com/fwlink/p/?LinkId=271938 and download the RBS_amd64.msi file.
    Click Start, click Run, type cmd into the Run text box, and then click OK.
    Copy and paste the following command into the Command Prompt window. Replace WSS_Content with the database name, and replace DBInstanceName with the name of the SQL Server instance. The action should finish within approximately one minute.

    1. msiexec /qn /lvx* rbs_install_log.txt /i RBS_amd64.msi DBNAME="WSS_Content" DBINSTANCE="DBInstanceName" ADDLOCAL=Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer
    Repeat this procedure for all web servers and application servers in the SharePoint farm.
    To confirm the RBS client library installati
    on
    The rbs_install_log.txt log file is created in the same location as the RBS_amd64.msi file. Open the rbs_install_log.txt log file by using a text editor and scroll toward the bottom of the file. Within the last 20 lines of the end of the file, an entry should read as follows: Product: SQL Remote Blob Storage – Installation completed successfully.


    On the computer that is running SQL Server 2008, verify that the RBS tables were created in the content database. Several tables should be listed under the content database that have names that are preceded by the letters "mssqlrbs".

    Enabling RBS for each content database
    To enable RBS by using Windows PowerShell

    Start the SharePoint 2013 Management Shell.
    For Windows Server 2008 R2:
    On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.
    For Windows Server 2012:
    On the Start screen, click SharePoint 2013 Management Shell.
    If SharePoint 2013 Management Shell is not displayed on the Start screen:
    Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.
    At the Windows PowerShell command prompt, type the following command:
      1. $cdb = Get-SPContentDatabase <ContentDatabaseName>
        $rbss = $cdb.RemoteBlobStorageSettings
        $rbss.Installed()
        $rbss.Enable()
        $rbss.SetActiveProviderName($rbss.GetProviderNames()[0])
        $rbss 



    Where: <ContentDatabaseName> is the name of the content database.


    Test the RBS installation

    You should test the RBS installation on one web server in the SharePoint farm to make sure that the system works correctly.To test the RBS data store

    On the computer that contains the RBS data store, click Start, and then click Computer.

    Browse to the RBS data store directory.

    Confirm that the folder is empty.

    On the SharePoint farm, upload a file that is at least 100 kilobytes (KB) to a document library.

    On the computer that contains the RBS data store, click Start, and then click Computer.

    Browse to the RBS data store directory.

    Browse to the file list and open the file that has the most recent changed date. This should be the file that you uploaded.


    reference Technet article.

    Sunday, May 11, 2014

    Error: Only machine administrators are allowed to create administration service job definitions of type: Microsoft.SharePoint.Administration.SPSolutionDeploymentJobDefinition

    When I'm trying to deploy a custom SharePoint 2013 solution to my Test Farm using a PowerShell script I received the Folowing error :
    Access denied.  Only machine administrators are allowed to create administration service job definitions of type: Microsoft.SharePoint.Administration.SPSolutionDeploymentJobDefinition, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=.....

    Access denied.  Only machine administrators are allowed to create administration service job definitions of type: Microsoft.SharePoint.Administration.SPSolutionDeploymentJobDefinition


    To fix this issue in Windows Server 2012 : you need to turn off UAC (User Account Control) via registry by changing the DWORD "EnableLUA" from 1 to 0 in "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system".

    User Account Control

     You will get a notification that a reboot is required. After the reboot, UAC is disabled.

    The error is fixed.
    Read about UAC in TechNet.

    Wednesday, May 7, 2014

    Tune your SharePoint Farm for better performance Part 1: IIS compression : Enabling GZIP compression

    To tune your SharePoint  Farm for better performance we recommend to configure the IIS compression (GZIP compression).

    IIS compression is turned on by default

















    but we need to configure it on all SharePoint WFE in few steps :

    - Open CMD window and run the following commands :

    CD \Windows\System32\Inetsrv\
    
    c:\Windows\System32\Inetsrv\appcmd list config -section:httpcompression
    this will show the current  settings.

    - Configuring gzip compression 
    Appcmd.exe  set config -section:httpCompression   -[name='gzip'].staticCompressionLevel:9   -[name='gzip'].dynamicCompressionLevel:7
    - Configuring CPU usage for compression
    appCmd set config -section:httpCompression /dynamicCompressionDisableCpuUsage:50 appCmd set config -section:httpCompression /dynamicCompressionEnableCpuUsage:30
    - Configuring minimum size before compression is applied
    appCmd set config -section:httpCompression /MinFileSizeForComp:512
    Enjoy performance...
    For more information TechNet Article.