Content types publishing across site collections - SharePoint 2013

I was working on SharePoint 2013 project for operations management. We had to create an operations portal to manage projects. After analyzing the requirements , limitation and threshold,  we decided to create a site collection per project. The main reasons was :
  • A content database size exceed 200Gb to avoid performance issues and to be able to use default backup/restore operations.
  • Ability to use different database servers for differents projects
  • Ability to move a project space from one content database to another
One of the issues that we have encountred is content type management. We had to create the same content types in each site collection and for every change in one site collection, we had to replicate it on the others.

We had two choices to solve this issue :
  • Custom development
  • Use a default SharePoint feature
Solving the issue with custom development could take us time that we haven't. We had to search SharePoint features to see if the is something that could help us.

After some research, we found that the SharePoint Managed Metadata service could be helpful for us. We will use the content type publishing feature of the Managed Metadata service.

To configure the service we have to follow the steps below :
  1. Create a site collection (Hub) that will host the content types that will be published.
  2. Configure the Managed Metadata Service to connect to the recently created site hub.
  3. Configure the Managed Metadata Service proxy to consume content types from the created hub
  4. Create content types in the Hub site and allow publishing
  5. Verify that the published content types are available in the other site collections

1. Create a site collection (Hub) that will host the content types that will be published.
  • Create a new site collection
  • Go to site collection feature
  • Activate the feature



2. Configure the Managed Metadata Service to connect to the recently created site hub
  • Go to central administration -> Application management -> Manage service applications
  • Select the "Managed Metadata service" and click "Properties" in the ribbon
  • At the bottom of the page , put the adress of your newly created site collection in the "Content Type hub" field
  • Click "Ok" to validate. The hub adress could only be updated using powershell



3. Configure the Managed Metadata Service proxy to consume content types from the created hub
  • Go to central administration -> Application management -> Manage service applications
  • Select the "Managed Metadata service " proxy and click "Properties" in the ribbon
  • Only check the 3rd and 4th checkboxes
  • Click "Ok"



4. Create content types in the Hub site and allow publishing
  • Go to hub site collection
  • Create a new content type
  • Add your custom columns
  • Click on "Manage publishing for this content type"
  • Select "Publish" and then "Ok"
 


5. Verify that the published content types are available in the other site collections
  • You have to wait a little bit until the synchronization job is executed
  • Go to a site collection different from the "Hub site collection"
  • Go to "Site settings"
  • Under "Site collection administration" click on "Content type publishing"
  • We will get the content types that have been published from the "Hub site collection"
     

     


     

     


 

SharePoint 2013 Farm documentation tool (SPDocumentor)

I have been working on a SharePoint 2013 project and one of my tasks was to document the server farm.
Documenting the farm manually takes too much time and i wasn't able to buy a third party tool to do that work.
I decided to create an application to automate the documentation process.
I called the tool "SPDocumentor" and i've published it on codeplex.
https://spdocumentor.codeplex.com/releases/view/112882
In the current release, i'm just generating documentation of the farm and web applications. I'll be working on it to document the : "Jobs, Site collections, backups ..."
The tool uses the SharePoint object model to access farm information and the "DocumentFormat.OpenXml.dll" to generate the target word document.


 

Fixing blank lookup columns in SharePoint when creating new site from a site template

One of the common issues when creating a new site from a site Template is that the lookup columns values are blanks. The full scenario is as below :
  • Create a SharePoint site
  • Add lists with lookup columns
  • Insert some data in the lists
  • Save the site as Template with its content
  • Create a new site from the Template
When you access the list which contains the lookup column, you will notice that the lookup values are empty. The lookup values still exist but they are not rendered. We have to fix the list schema by updating some properties of the lookup column. Two properties have to be updated :
  • The Web Id
  • The List Id
There are two ways to fix the list schema :
  • Using C#
  • Using Powershell
We will see how to fix the error using Powershell. The script below will let you fix the column.

$web = Get-SPWeb "Your web url"
$list = $web.Lists["Your list name"]
$column = $list.Fields["Your column name"]
$lookupList = $web.Lists["Your source list name"]
#Updating the column properties
$column.SchemaXml = $column.SchemaXml.Replace($column.LookupWebId.ToString(), $web.ID.ToString())
$column.SchemaXml = $column.SchemaXml.Replace($column.LookupList.ToString(), $lookupList.ID.ToString())
$column.Update()
write-host "Column properties have been updated"
$Web.Dispose()
  
More details about the lookup columns on MSDN.



 

SharePoint 2013 resources on SDPS website


Microsoft has created a website for the SDPS (SharePoint Deployment Planning Services) program. Using this program, a customer can use his software assurance benefits to cover deployment and upgrade  planning services costs.
The web site contains many important resources that help Microsoft partners to improve their demo and PoC.
Here some key resources that I found on the website
 

August CU Updates for SharePoint 2013 has been released

The August  CU Updates for SharePoint 2013 has been released. Below are links for August CU.

  • KB 2751999 - SharePoint Foundation 2013
  • KB 2726992 - SharePoint Server 2013
  • KB 2775426 - SharePoint Server 2013 with Project Server
  • KB 2799821 - Office Web Apps Server 2013

  • Make sure to run the SharePoint configuration wizard after installing the update.

    Fixing Error : GetUserListSchema(): Failed to get the list schema XML for feature

    One of the common error that you may encounter when you try deploy a SharePoint solution is :

    Error 36 Error occurred in deployment step 'Activate Features': Cannot complete this action.
    Please try again.

    After analyzing the SharePoint log files I found out the error bellow :

    GetUserListSchema(): Failed to get the list schema XML for feature

    The error above has been caused by the manipulation bellow :

    In this project I had only one feature that contained the list definition and the list instance and then I have created a new feature scoped site and move the list definition to it. I kept the list instance in the scoped web feature.

    In order to fix the problem, you have to edit the element.xml of the list instance and add the featureid attribute. The feature id attribute should be the id of the list definition's feature.

    Here is a sample element.xml file.


    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="
    http://schemas.microsoft.com/sharepoint/">
      <ListInstance Title="ListInstanceName"
                    OnQuickLaunch="TRUE"
                    TemplateType="10000"
                    FeatureId="644d32f3-30d8-441f-a24c-84cd3931cdf0"
                    Url="Lists/ListInstanceName"
                    Description="My ListInstanceName">
      </ListInstance>
    </Elements>

    SharePoint 2013 Configuration Wizard Error : The SDDL string contains an invalid sid or a sid that cannot be translated

    I was setting up a new SharePoint Server 2013 Environment for development purposes. The installation type was "Standalone". At step 8 of the wizard, an error occurred :

    Exception: System.ArgumentException: The SDDL string contains an invalid sid or a sid that cannot be translated.
    Parameter name: sddlForm


    After googling a little bit I found out that the possible cause was that the wizard wasn't able to share a folder under "C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server".

    To fix the problem you have to share the following folder :"C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Analytics_{GUID}"

    
     

    The visio stencil for SharePoint , Exchange, Lync and Office 2013

    Microsoft have released a Visio stencil that contains more than 300 icons to help you create a nice visual representations of your architectures.



    You can download the stencil from : New Office Visio Stencil

     

    Office and SharePoint APP DevCamp : Session 3


    Dear Developer,

    You are invited to attend the third Office/SharePoint DevCamps to be held at the Microsoft Innovation Center in Tunis on May 13th  from 9am to 5pm! This is a fun and free event especially for you. For those of you who have attended the previous sessions, this one will be heavily focused on hands-on development labs.

    We are pleased to have Fathi Dridi the Technical Leader on Sharepoint from Dot I.T. as the trainer for this session. Remember the objective is to drive Productivity Apps for the Office & SharePoint Store on dev.office.com!

    Your Challenge:
    ·         The developers of the first FIVE approved Productivity apps to be published to the Store on office.com will have their application featured on Microsoft’s Channel 9.
    o   Application must be approved by Microsoft’s Corporate DPE team
    o   Must be an App for Office/SharePoint Productivity solution
    Please RSVP as soon as possible by emailing Olfa Hassine at: i-olfah@microsoft.com

    SharePoint 2013 DevCamp - Session 2


    Dear Developer,
    You are invited to attend our second Office/SharePoint DevCamp to be held at the Microsoft Innovation Center in Tunis on April 29th! This is a fun and free event especially for you. The objective is to drive Productivity Apps for the Office & SharePoint Store on dev.office.com!

    This second session will be animated by the Microsoft partner IP Tech. And we look forward to having you all among us!





    Remember Your Challenge!!
    ·         The developers of the first FIVE approved Productivity apps to be published to the Store on office.com will have their application featured on Microsoft’s Channel 9.
    o   Application must be approved by Microsoft’s Corporate DPE team
    o   Must be an App for Office/SharePoint Productivity solution

    Please confirm your presence by emailing: i-olfah@microsoft.com

    SPCAF : A very useful code analysis tool for SharePoint

    In the last 5 days, my mission was to analyze a set of SharePoint solutions that was developed during 6 months and to write a document that lists things that should be fixed or enhanced. Usually, my analysis tasks is based on FxCop,SPDisposeCheck and Source code analysis. This time i've googled a littled bit in order to see if there is a tool that could help me automating my task. After 2 minutes of search, i found a tool in Microsoft Visual Studio Gallery called : SPCAF (SharePoint Code Analysis Framework).It is still in BETA version.

    SPCAF cannot only analyze assemblies like other tools as FxCop or SPDisposeCheck. It can also analyze all the XML code in SharePoint packages like Features, ContentTypes, ListTemplates and all the other files like controls (.ascx), pages (.aspx) and master pages (.master) etc.

    The tool can be run in 5 different modes :

    • Integrated with visual studio 2012/2010
    • Client application
    • Integrated into a Team Build
    • Command line
    • MSBuild Task
    Client Application

    Integrated with Visual Studio

    SPCAF client application is able to analyse SharePoint solution without the need of source code. You'll have to use the WSP files as an input to SPCAF. Differents analysis rules are available. 
    SPCAF generates 4 types of reports :
    • Rules Report
    • Code metrics Report
    • Dependencies Report
    • Inventory Report
    It is amazing how the tool is useful. One of the best advantages of this tool is that it doesn't only tell what's wrong but also how to fix that error.

    Great thanks to Torsten Mandelkow and Matthias Einig :)



    Office/SharePoint DevCamps in Tunisia

    You are invited to attend the first Office/SharePoint DevCamps to be held at the Microsoft Innovation Center in Tunis on April 15th! This is a fun and free event especially for you. The objective is to drive Productivity Apps for the Office & SharePoint Store on dev.office.com!

    A 5-Days Challenge : 
    ·         Monday, April 15, 2013
    ·         Monday, April 29, 2013
    ·         Monday, May 13, 2013
    ·         Monday, May 27, 2013
    ·         Monday, June 10, 2013

    In this very special first edition we are pleased to welcome Microsoft Certified Trainer for SharePoint, Marko Kokol from Slovenia: MCT, MCPD, MCITP, MCTS he is the R&D Lead of Virtua IT d.o.o., a Slovenian company specialized in providing SharePoint products and services in the region. He has more than 10 years of experience in delivering SharePoint services to customers ranging from retail industries to integrating SharePoint based e-learning solutions for public international organizations..



    Your Challenge:
    ·         The developers of the first FIVE approved Productivity apps to be published to the Store on office.com will have their application featured on Microsoft’s Channel 9.
    o   Application must be approved by Microsoft’s Corporate DPE team
    o   Must be an App for Office/SharePoint Productivity solution

    For further information about the event, you can contact Alia Mahmoud  a-almahm@microsoft.com or Ahmed Kaddour: kadahmed@microsoft.com 

    Installing my SharePoint Server 2013 Farm – Part 3/6

    Installing and Securing SQL Server 2012

    This tutorial is the third part of the Series "Installing my SharePoint Server 2013 Farm".
    The series is as follow :

    Installing SQL Server 2012

    We have to create 3 domain accounts and the others will be virtual accounts. Bellow the accounts that we will create : 
    Service                                                                     Account name
    Database engine                                                      svcSQLAcc01   
    SQL Server Agent                                                    svcAGSQLAcc01
    SSAS                                                                         svcSSASSQLAcc01

    To create these accounts follow the steps bellow
    •           Connect to the domain controller machine
    •           Open the “Active Directory Users and Computers” management console
    •           Create a new organization unit called “SQLAccounts
    A particularly useful type of directory object contained within domains is the organizational unit. Organizational units are Active Directory containers into which you can place users, groups, computers, and other organizational units. An organizational unit cannot contain objects from other domains. (see technet)


    •  Now create the users within the newly created Organization Unit “SQLACcounts”. Right client on the "OU" and the click “Add” the “User”


    -          When you finish you will have the 3 domain accounts : 


    Before we start installing SQL Server 2012 we must install the “Microsoft Framework 3.5”. The framework is available as a “Windows Feature”.

    To begin SQL Server 2012 installation follow the steps bellow:
    •          Connect to the SQL Server machine
    •           Insert the SQL Server 2012 image file or DVD in the right drive.
    •           Start the installation wizard
    •           Click on “Installation” and then on “New SQL Server standalone installation”


    • The “Setup Support Rules” screen appears.  Click “OK”


    •           In the next screen, uncheck the “Include SQL Server product updates” and click “Next”
    •           The “Install Setup Files” screen appears. Click “Install”
    •           The “Setup Support Rules” screen appears.  The setup support rules identify problems that may occur when you install SQL Server Setup Support Files. Failures must be fixed before setup can continue. When no failure detected click “Next”


    •          In the “Setup Role” screen , select “SQL Server feature installation” and click “Next”      Check all features in the “Feature Selection” wizard step.


    •         Click “Next” to go to the next screen. In the “Installation Rules” screen, the wizard will execute rules to determine if the installation process will be blocked.  Make sure everything is green.

    •         In the “Instance Configuration Screen”, Click on “Named Instance” radio button. In the SQL  Instance name textbox, type the name you want. In this tutorial I’ve used “SQL01”. Give also an instance ID in the textbox “Instance ID”. I’ve used the same as instance name “SQL01”.


    •        Click “Next” to go to the “Server Configuration” screen.
    •       In the Configuration Screen and under the “Service Accounts” tab, set the right account for the right service as bellow. Click “Next”.


    •        The “Database Engine Configuration” screen appears. Set authentication mode to Windows authentication mode.  Add the “svcSQLAcc01” and “Administrator” accounts as administrator accounts.  Click “Next”. (KB2028697) 
    •   In the Analysis Services Configuration screen, add the “svcSQLAcc01” and “Administrator” accounts as analysis service administrator accounts. Select the “Multidimensional Mode” instead of “Tabular mode”. Click “Next”
    •  The “Reporting services configuration” screen appears. Under “Reporting services Native Mode” check the “install and configure”. Under “Reporting Services SharePoint integrated mode” check the “Install Only”. Click “Next”
    • In the “Distributed Replay Controller” screen, add “svcSQLAcc01” and “Administrator” accounts as users that have permissions to DRC.
    • Click “Next” to open the “Distributed Replay Client” screen. In the controller name type the name of the current machine “SQL-VM-SV01”
    Similar to SQL Server Profiler, you can use Distributed Replay to replay a captured trace against an upgraded test environment. Unlike SQL Server Profiler, Distributed Replay is not limited to replaying the workload from a single computer.Distributed Replay offers a more scalable solution than SQL Server Profiler. With Distributed Replay, you can replay a workload from multiple computers and better simulate a mission-critical workload.The Microsoft SQL Server Distributed Replay feature can use multiple computers to replay trace data and simulate a mission-critical workload. Use Distributed Replay for application compatibility testing, performance testing, or capacity planning. (see msdn)

    -          Click “Next” and then begin the installation process.

    Now you have successfully installed your SQL Server 2012. 

    Securing SQL Server


    To secure SQL Server you have to follow the steps bellow:


    •        In SQL Server , configure the SQL Service to listen to a non default port (See msdn)





    • Block SQL Server default listening ports (See msdn)

    -           

    •           Open manually assigned port in windows firewall  (See msdn)


    •            Configure SQL Server Client Alias in SharePoint Server Machine
    •       In order to add a new SQL Server Alias in the SharePoint machine, you have to install the "SQL Server Native client"
    •           Open a powershell console and type “cliconfg”. Press enter
    •           The “SQL Server Client Network Utility” screen will appear.

    o   Click on the “Alias” tab
    o   Click on the “Add” button

    o   In the “Network libraries” click on “TCP/IP”
    o   In the Server Alias textbox, type the Alias you want to use “SharePoint_Alias”
    o   In the Server name type the SQL server name
    You can use "SQL Server Configuration Manager" to create the Server Alias (see msdn)
                You've just installed and secured your SQL Server


    Upgrade from SharePoint 2010 to SharePoint 2013



    The upgrade from SharePoint 2010 to SharePoint 2013 can only be done using the Database-Attach method. 
    The upgrade process is composed by three steps : 
    • Prepare for upgrade
    • Upgrade Database
    • Upgrade Sites


    Click here to view the SharePoint 2013 Upgrade process

    PREPARE FOR UPGRADE

    PLAN FOR UPGRADE


    PREPARE 2013 FARM (See msdn)


    Phase 1 of the upgrade process: Create SharePoint 2013 farm

    UPGRADE DATABASES


    • Upgrade services applications to SharePoint 2013 (See msdn)
    • Upgrade Content database (See msdn)
    • Verify upgrade for databases (See msdn)
    • Migrate from classic-mode authentication to claim-based authentication (See msdn)


    UPGRADE SITE COLLECTIONS

    Installing my SharePoint Server 2013 Farm – Part 2/6


    Installing the Farm Domain Controller (AD DS)

    This tutorial is the part 2 of the series « Installing my SharePoint Server 2013 Farm ». The series is as follow :
    In this tutorial we will install the Farm’s Domain Controller. In the previous post we’ve created a virtual machine that we’ve called “AD-VM-SV01”. We will use it to install the “Active Directory Domain and Services” Role.
    The steps bellow will guide you to install the AD-DS role.
    -        Start the virtual machine “AD-VM-SV01”
    -        Open the “Server Manager” then click on “Local Server”
    -        Click on the current computer Name, the “System Properties” window will display
    -        Click on “Change” button
    -        The “Computer Name/ Domain Changes” window appears.
    -        Enter “AD-VM-SV01” in the computer name text box.
     img1ad
    -        Restart the virtual machine when asked to.
    Before starting the AD-DS role installation, you have to set a static IP address for the network card. Open the “Network and sharing center” , click on you current “Active Connections” and then set an IP address.  In the DNS field put 127.0.0.1
    In previous versions of Windows Server we used to use the DCPROMO command in order to install a new “AD-DS and DNS”. In Windows Server 2012 this has been made easier using the “Roles and Features” setup screen.
    -        Once the machine started, open the “Server Management console” and click on “Add Role and Feature” under the “Manage” button.
    -        As we’ve seen in the previous tutorial, you have to select “Role based or feature based installation” and then choose the target machine which is your local server.  This server will be promoted as domain controller.
    -        In the role list, check “Active Directory Domain and Service” role. A new dialog will appear to install dependent features. Click “Add Features”
    -        The Active Directory Domain and Service page will appear in which you’ll get the summary of the role.
    -        Click “Next” and you will get a screen to begin the “Installation Process”
    -        Click “Install”
    After the installation process finishes, a new link will appear “Promote this Server to a Domain Controller”. Click on the link to make the server a domain controller.
    -        The “Active Directory Domain and Service configuration Wizard” appears. We have to choose a deployment configuration. Since this server is the first Domain Controller in your virtual environment, we’ll select “Add new forest”. A textbox will appear to set the root domain name. In this tutorial I’ve used “factory.local”
    In the Active Directory directory service, a forest is a set of naming contexts (NCs) consisting of one schema NC, one config NC, and one or more domain NCs. Because a set of NCs can be arranged into a tree structure, a forest is also a set of one or several trees of NCs. (see msdn)
    image21
    -        Click “Next” to move to the “Domain Controller options” screen.
    -        You have to select the “Forest functional level” and the “Domain functional level”. In both lists we will select “Windows Server 2012”
    image31
    The fact that this server is the first domain controller in a new forest explains why the “Global Catalog GC” is checked and the “Read Only Domain Controller RODC” is unchecked as well as why both of them grayed.
    The global catalog is a distributed data repository that contains a searchable, partial representation of every object in every domain in a multidomain Active Directory Domain Services (AD DS) forest (see technet)
    -        Make sure to check the “Domain Name System DNS Server” to install the DNS Role on the same machine.
    -        Type and confirm a password for the active directory restore mode.
    -        Click “Next” to move to the DNS options page. A warning will appear indicating that a delegation for the DNS Server cannot be created. Don’t worry about that, this is because DNS Service is not installed yet.
    image41
    -        Click “Next” to move to additional options page. In the NetBIOS textbox type “AD-VM-SV01” and click next to move to the AD DS files locations page.
    -        Keep files locations as they are. You can change them if you want. Click “Next”
    image51
    -        The “Prerequisites” page appears. Some warnings appear in the results view, just check at the top of the screen if a successful message appears “All prerequisites checks passed successfully, click “Install” to begin the installation.
    image61
    Once installation finishes, restart the computer and logon using the account: factory\administrator
    image71
    Now you have successfully installed your farm domain controller. Next step is to add the SQL and SharePoint machines to the recently installed domain controller.
    image81