Sharepoint Power Shell Create a Site Collection in a Specific Data Base

By default, Site collections are created on the web application database. If you want to create a Site Collection in a diferent database, you can use the following Script:

#Create the Database

New-SPContentDatabase -Name New_Content_DB  -WebApplication http://myWebApplication

#Create the Site Collection

New-SPSite http://myWebApplication/newSite -OwnerAlias <owner account name including domain name e.g.domain\username> -ContentDatabase New_Content_DB -Name <Name of your site collection> -Description <Description of site collection> -Template “STS#0”


You should also configure your WebApplication Paths to be able to create your site collection in a specific url.

Sharepoint 2013 – Configure Search with Power Shell

The following script will configure the Search Service and Components on a SharePoint 2013 Server:

$AppSearch = "SERVERNAME"

$SearchAppPoolName = "SharePoint_SearchApp"

$SearchAppPoolAccountName = "domain\username"

$SearchServiceName = "SharePoint_Search_Service"

$SearchServiceProxyName = "SharePoint_Search_Proxy"

$DatabaseName = "SharePoint_Search_AdminDB"

#Create a Search Service Application Pool

$spAppPool = New-SPServiceApplicationPool -Name $SearchAppPoolName -Account $SearchAppPoolAccountName -Verbose

#Start Search Service Instance on all Application Servers

Start-SPEnterpriseSearchServiceInstance $AppSearch -ErrorAction SilentlyContinue

Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance $AppSearch  -ErrorAction SilentlyContinue

#Create Search Service Application

$ServiceApplication = New-SPEnterpriseSearchServiceApplication -Partitioned -Name $SearchServiceName -ApplicationPool $spAppPool.Name -DatabaseName $DatabaseName

#Create Search Service Proxy

New-SPEnterpriseSearchServiceApplicationProxy -Partitioned -Name $SearchServiceProxyName -SearchApplication $ServiceApplication

$clone = $ServiceApplication.ActiveTopology.Clone()

$AppSSI = Get-SPEnterpriseSearchServiceInstance -Identity $AppSearch

#Configure Search Components

New-SPEnterpriseSearchAdminComponent –SearchTopology $clone -SearchServiceInstance $AppSSI

New-SPEnterpriseSearchContentProcessingComponent –SearchTopology $clone -SearchServiceInstance $AppSSI

New-SPEnterpriseSearchAnalyticsProcessingComponent –SearchTopology $clone -SearchServiceInstance $AppSSI

New-SPEnterpriseSearchCrawlComponent –SearchTopology $clone -SearchServiceInstance $AppSSI

New-SPEnterpriseSearchQueryProcessingComponent –SearchTopology $clone -SearchServiceInstance $AppSSI

$PrimaryIndexLocation = "C:\Data"

$ReplicaIndexLocation = "D:\Data"

#We need two index partitions and replicas for each partition. Follow the sequence.

New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $AppSSI -RootDirectory $PrimaryIndexLocation -IndexPartition 0

New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $AppSSI -RootDirectory $ReplicaIndexLocation -IndexPartition 1


Sharepoint 2013 App with Custom Lists

This post is about how to create a SharePoint 2013 App in Visual Studio 2012 with a Custom List.
To start that, you need to create an “App for SharePoint 2013” project:

Then, add a new item to your project and select “List”:


You’ll go through a wizzard where you can select if you want to create a list instance, based on an existing template, where you can’t change that template.

Or, if you want to create a list, and a template, that you can change, based on an existing template. 

Let’s start with a list based on a template that you can’t change:


Create a list named “CustomList” based on a Document Library template:


Now, let’s choose the other option and create CustomList2:


In this case, you’ll have another step, where you can define your document’s template:


And another step, where you can add more columns, in my case, I add an Attachments column:


Now, I edited my default.aspx file, to include links to my new lists:



Finally, deployed my solution and see my new app with these two Custom Lists.

Office 365 Sharepoint Online – Promoted Sites

If you want to display diferent promoted sites to diferent users or groups, in SharePoint Online My Sites, you can do that with audiences.

Go to your Office 365 SharePoint Online administration, and navigate to “user profiles -> My Site Settings -> Manage Promoted Sites”:

promoted sites

Office 365 Sharepoint Online – External Users

In Office 365 you can give access to your portal, to domain users, or to external users.
To give external users access, you need to go to your office 365 administration, and set your site collection Sharing Properties.


You can define if you want to enable anonymous users or only authenticated accesss:


After saving your settings, you need to go to your Portal, and invite your external users, you need to click on Share, and then enter your external users email and permissions:


Your external users, will receive an invitation email, and after they accept that, they will be able to log on.

You can monitor your invitations at “Site Settings -> Access Requests and Invitations”:



Sharepoint 2007 Workflows Logs

If you have problems in Workflows, you can activate Workflows logs to see which activities are generating errors.

You should do this in two places, one in your SharePoint portal’s web.config file, and also for owstimer process.

For owstimer, you should go to 12\bin folder and create a new file “owstimer.exe.config” with the following code:

<?xml version="1.0" encoding="utf-8"?> 




      <source name="System.Workflow.Runtime" >


          <add name = "System.Workflow"/>



      <source name="System.Workflow.Runtime.Hosting">


          <add name="System.Workflow"/>



      <source name="System.Workflow.Activities">


          <add name="System.Workflow"/>





      <add name="System.Workflow"






      <add name="System.Workflow.LogToTraceListeners" value="1"/>

      <add name="System.Workflow.Runtime" value="All" />

      <add name="System.Workflow.Runtime.Hosting" value="All" />

      <add name="System.Workflow.Runtime.Tracking" value="All" />

      <add name="System.Workflow.Activities" value="All" />

      <add name="System.Workflow.Activities.Rules" value="All" />




For your portal’s web.config file you should copy the system.diagnostics section.

Office 365 Access Services Sample

This post is about how to create an Access Application in Office 365 SharePoint Online.

First you need to create a new Access App. Go to your site menu, and select “Add an app”:


Select the “Access App” option:


Give your app a name and create it, mine is AccessApp1.

Next click in your new application.


Click to open your new application and start adding tables:


You’ll open your application in Access Client, where you can start adding tables based on access templates or create your tables without any template:


In this case I selected the “Book Collection” template and it automatically created the following tables:


Save your new application and start using it in your SharePoint Online Portal. You’ll have automatically the create, edit, list and delete operations available: