Feeds:
Posts
Comments

Archive for June, 2015

When Creating an Office 365 SharePoint site, you might want to turn on custom Scripting.

Steps here: https://support.office.microsoft.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f?CorrelationId=365c212d-8b7e-45b9-b285-84416dd95952&ui=en-US&rs=en-US&ad=US

 

With Custom Scripts turned off you might experience some weird behavior like:

  • Content Types and Site Columns Galleries are not showing up in the Site Actions menu.
  • When Mapping a SharePoint Library to a local drive, you might get Access denied errors when trying to upload files.
  • CEWP and Script editor web part might be missing from the Web parts list when editing a page.

 

References:

Read Full Post »

Here is a simple script to create the site structure for SharePoint Online based on a csv file.

The script is using the Client-side SharePoint PowerShell project from Codeplex (https://sharepointpowershell.codeplex.com/ ).

 

In order to create the site structure just fill the csv file of the following format

Url,Name,Template,Description,Language
Blog,Blog,BLOG#0,Blog,1033
Subsite1, SubSite1, STS#0, Name1, 1033
SubSite1/Subsite11, Name11, STS#0, Description, 1033
SubSite1/Subsite11/Subsite1111, Name3, STS#0, Description, 1033

 

And then use the following script

 

Import-Module "$PSScriptRoot\spps.psm1"
Import-Module "$PSScriptRoot\spps.subsites.psm1"
Import-Module "$PSScriptRoot\ConfigCredentials.ps1"

Initialize-SPPS -siteURL $O365SiteUrl -isOnline $true -onlineusername $username -onlinepassword $password

Import-Csv $PSScriptRoot\SiteStructure.csv  | ForEach-Object{

    $name = $_.Name
    $template = $_.Template
    $description = $_.Description
    $lang = $_.Language
   
    Write-Host "Processing " $name " "  $_.Url
    Open-Rootsite
   
    $relUrl = ""   
    foreach($subsite in $_.Url -split "/")
    {
        $relUrl += "/"+ $subsite
        try
        {
            Open-Subsite -relativeUrl $relUrl
            Write-Host "Site" [$relUrl] "Already exists"
        }
        catch
        {
            Write-Host "Trying to create" $subsite
            Add-Subsite -title $name -url $subsite -webTemplate $template -language $lang -description $description
        }
    }
    Write-Host " ———————– "
}

 

Note, the Script ConfigCredentials.ps1 is used to store the Site Url and the credentials as follows

$O365SiteUrl = “https://url_here
$username = username@domain.com
$password = "password"

 

Note: to make sure the script behaves as expected, make sure that the hierarchy in the csv file is in order. i.e.

Subsite1
Subsite1/Subsite2

in other words do no list the sub site before its parent site.

Read Full Post »