Monday, March 29, 2010

Enable FILESTREAM (RBS) for SharePoint 2010

    Technet article: http://technet.microsoft.com/en-us/library/ee748631%28office.14%29.aspx

    Run the following commands in SQL Server management query window. Change the database name as needed.

    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'

    clip_image001

    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:\Blob')

    to filegroup RBSFilestreamProvider

    clip_image002

    After activating this three commands you will find some files in the new folder c:\blob. Important. This folder will be created by the sql command.

    clip_image003

    Install RBS

    http://go.microsoft.com/fwlink/?LinkId=177388

    clip_image004

    Do not run the msi file directly.

    On the database and first SQL server run the following command:

    msiexec /qn /lvx* rbs_install_log.txt /i RBS_X64.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="WSS_Content" DBINSTANCE="" FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1

    Fill in the SQL instance name for specific SQL server instances.

    Run the following command on all other SharePoint servers:

    msiexec /qn /lvx* rbs_install_log.txt /i RBS_X64.msi DBNAME="WSS_Content" DBINSTANCE="" ADDLOCAL="Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer"

    Check rbs_install_log.txt after installation:

    >>>> Product: SQL Remote Blob Storage -- Installation completed successfully.

    To enable RBS on a specific web application open the SharePoint Management Shell on run this commands

    $cdb = Get-SPContentDatabase –WebApplication http://moss2010server

    $rbss = $cdb.RemoteBlobStorageSettings

    $rbss.Installed()

    $rbss.Enable()

    $rbss.SetActiveProviderName($rbss.GetProviderNames()[0])

    $rbss

    clip_image005

    After the activation you can find additionals files and folder in the blob folder

    clip_image006

    After uploading a file (in this example rbs_install_log.txt) in a document library

    clip_image007

    You will find new folders and files (with guid names) in the blob directory structure.

    clip_image008

    If you upload a new version of this file, the new file will be place in the same folder with a new name. SharePoint does not save the difference only.

    clip_image009

Saturday, March 20, 2010

Workflows with Visio and SharePoint Designer

    Create a new Visio diagram

    clip_image001

    Choose Microsoft SharePoint Workflow

    clip_image002

    The following Actions are supported by Visio to design a workflow:

    clip_image003

    clip_image004

    After you designed the workflow do not forget to add an start and an end to the workflow

    clip_image005

    Export the workflow in the Visio Workflow Interchange format

    clip_image006

    Open SharePoint Designer and connect to the site collection where you want to enable the Visio workflow

    clip_image007

    Open up the workflow site objects and click on the button "Import from Visio"

    clip_image008

    Select the vmi file create and exported with Visio

    clip_image009

    After choosing the workflows file a wizard will be started

    clip_image010

    You can define the name for the workflow and choose the type

    • Bound to a list or library or
    • Reusable (all or specific content type)

    clip_image011

    SharePoint Designer is preparing the workflow configuration

    clip_image012

    The following pictures shows the workflow designed in Visio. You can now change the name (ID3) and all blue underline terms and configure the actions.

    clip_image013

    For example

    • increment a variable
    • copy the current item to the calendar list
    • replace contribute permissions of the current item to read permissions
    • the finally send a mail to the administrator

    clip_image014

    If there is a error in the workflow definition, you will get the following error message.

    clip_image015

    Save the xoml file to SharePoint.

    clip_image016

    After saving the workflow you can configure it with SharePoint Designer

    clip_image017

    And now we will test the workflow. First of all we need a element in the calendar list

    clip_image018

    And now we need to start the new workflow

    clip_image019

    Click on SharePoint Workflow

    clip_image020

    And click on Start

    clip_image021

    After starting we can have a look to the workflow history

    clip_image022

    Here we can see the SharePoint Designer/Visio workflow completed

    clip_image023

    In my environment if you want to see the workflow diagram i get a unexpected error.

    clip_image024

Wednesday, March 10, 2010

List of all user/group rights for a SharePoint web application

The following T-SQL command will list all user/group rights defined for all site collection of web application

-- Query to get all the users assigned to roles
SELECT DISTINCT
CASE WHEN PATINDEX('%\%', FullUrl) > 0 THEN LEFT(FullUrl, PATINDEX('%\%', FullUrl) - 1) ELSE FullUrl END AS [Site],
Webs.Title,
Webs.FullUrl,
Perms.ScopeUrl,
UserInfo.tp_Login As Account,
CASE WHEN UserInfo.tp_DomainGroup>0 THEN NULL ELSE UserInfo.tp_Title END AS Username,
CASE WHEN UserInfo.tp_DomainGroup>0 THEN UserInfo.tp_Login ELSE NULL END AS [AD Group],
NULL AS [SharePoint Group],
Roles.Title AS RoleTitle,
Roles.PermMask
FROM
dbo.RoleAssignment
INNER JOIN dbo.UserInfo ON RoleAssignment.SiteId = UserInfo.tp_SiteID AND UserInfo.tp_ID = RoleAssignment.PrincipalId
INNER JOIN dbo.Perms ON Perms.SiteId = RoleAssignment.SiteId AND Perms.ScopeId = RoleAssignment.ScopeId
INNER JOIN dbo.Roles ON RoleAssignment.SiteId = Roles.SiteId AND RoleAssignment.RoleId = Roles.RoleId
INNER JOIN dbo.Webs ON Roles.SiteId = Webs.SiteId AND Roles.WebId = Webs.Id
WHERE
Roles.Type<>1 AND tp_Deleted=0
UNION
-- Query to get all the SharePoint groups assigned to roles
SELECT DISTINCT
CASE WHEN PATINDEX('%\%', FullUrl) > 0 THEN LEFT(FullUrl, PATINDEX('%\%', FullUrl) - 1) ELSE FullUrl END AS [Site],
Webs.Title,
Webs.FullUrl,
Perms.ScopeUrl,
UserInfo.tp_Login As Account,
CASE WHEN UserInfo.tp_DomainGroup>0 THEN NULL ELSE UserInfo.tp_Title END AS Username,
CASE WHEN UserInfo.tp_DomainGroup>0 THEN UserInfo.tp_Login ELSE NULL END AS [AD Group],
Groups.Title AS [SharePoint Group],
Roles.Title AS RoleTitle,
Roles.PermMask
FROM
dbo.RoleAssignment
INNER JOIN dbo.Roles ON RoleAssignment.SiteId = Roles.SiteId AND RoleAssignment.RoleId = Roles.RoleId
INNER JOIN dbo.Perms ON Perms.SiteId = RoleAssignment.SiteId AND Perms.ScopeId = RoleAssignment.ScopeId
INNER JOIN dbo.Webs ON Roles.SiteId = Webs.SiteId AND Roles.WebId = Webs.Id
INNER JOIN dbo.Groups ON RoleAssignment.SiteId = Groups.SiteId AND RoleAssignment.PrincipalId = Groups.ID
INNER JOIN dbo.GroupMembership ON GroupMembership.SiteId = Groups.SiteId AND GroupMembership.GroupId = Groups.ID
INNER JOIN dbo.UserInfo ON GroupMembership.SiteId = UserInfo.tp_SiteID AND GroupMembership.MemberId = UserInfo.tp_ID
WHERE
Roles.Type<>1 AND tp_Deleted=0

Monday, March 8, 2010

Wiki's in SharePoint 2010

      There two different ways to handle wikis in SharePoint 2010

    1. Wiki Page Library

      Create a new wiki library

      clip_image001[6]

      Here is the list of list/library temples available

      clip_image002[6]

      If you choose the wiki page library you will have the follwoing screen

      clip_image003[6]

      You can edit this wiki pages like normal pages

      clip_image004[6]

      New in version 14 is the use of web parts in wiki pages. This picture shows you the different possibilities to add informations to a wiki page.

      clip_image005[6]

      For exaple pictures can now be uploaded directly to a library and included in the wiki page with one step

      clip_image006[6]

      Web parts can be added to the wiki page

      clip_image007[6]

      Existing and new lists can be added

      clip_image008[6]

      In edit mode [[link]] can be used you add a link

      With [[ (ctrl-space) a choice of all wiki pages will be displayed

      clip_image009[6]

      There is also a new site feature

      clip_image010[6]

      This feature handles the complete site like a wiki. The wiki start page will be the start page for the site collection

    2. Enterprise Wiki

      In site collection with the publishing feature active you can create Enterprise wikis (library)

      clip_image011[6]

      This enterprise wikis do have some additional functionally

      The page layout can be changed (or/and deployed centrally)

      clip_image012[6]

      It can look like this

      clip_image013[6]

      There is also a feature to use reusable Content

      clip_image014[6]

      clip_image015[6]

      The ribbon bar shows in the enterprise version a symbol to add video and audio

      clip_image016[6]

      New in SharePoint 2010 for wiki page is the HTML edit mode

      clip_image017[6]