Feeds:
Posts
Comments

Archive for the ‘Tips’ Category

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 »

For some reason if you set the Properties Hashtable of the File added as (“Title”, “TitleValue”), sharePoint just ignores it.

 

The Trick is to set the Title using (“vti_title”, “TitleValue”)

Read Full Post »

when developing a custom SPD 2010 workflow activity using Visual Studio , sometimes you can get an error saying “"Cannot find property named PROPERTYNAME on activity type ACTIVITYNAME" when trying to assign a parameter to a workflow activity. This can especially occur if the parameter is newly added to the activity (I.e. your previous version of the activity did not have this parameter or  it had it with a different name.

a solution might be to close the SPD and clear the cache at:

Windows 7:
C:\Users\<username>\AppData\Local\Microsoft\WebsiteCache
Delete all the files and folders in this folder

C:\Users\<username>\AppData\Roaming\Microsoft\SharePoint Designer
Delete all the files and folders in this folder

 

Reference: http://social.technet.microsoft.com/Forums/el-GR/sharepoint2010customization/thread/df776261-17d3-4771-88bb-572cf7b1df5d

Read Full Post »

For some reason when creating a custom ribbon action with Visual studio it seems that no matter what you do, the ribbon button or action are never updated.

The Solution that worked for me is

1) retract the solution

2) delete the feature from the Visual studio project

3) Create a new feature in the visual studio project and add the custom ribbon action

4) deploy the new feature.

Read Full Post »

I had a custom web part that is running code that required elevated privileges and was running within SPSecurity.runWithElevatedPrivileges  as below

 

SPSecurity.RunWithElevatedPrivileges(delegate()

{

   SPSite siteColl = SPContext.Current.Site;

   ….

}

I kept throwing an access denied error.

after some investigation I found the solution at this useful blog.

http://blogs.msdn.com/b/sasohail/archive/2010/10/31/access-denied-within-spsecurity-runwithelevatedprivileges.aspx

 

the problem in short is, I was using a reference to the SPSite obtained from the SPContext. This reference to SPSite was created before the code entered the RunWithElevatedPrivileges block. Therefore, the reference to the SPSite was running under the current user privileges even though it was placed within the RunWithElevatedPrivileges block.

 

The solution is to obtain a new reference to the SPSite created within the RunWithElevatedPrivileges block as shown below.

SPSecurity.RunWithElevatedPrivileges(delegate()
{
    using (SPSite siteColl = new SPSite(SPContext.Current.Site.ID))
    ….

}

Read Full Post »

When building a custom role provider for SharePoint 2010, make sure of the following:

  • The Role Provider section must be added to the following web.configs
    • Central Admin
    • The Security Token Service
    • The Web application
  • The <RoleProvider tag in the web.config must have:
    • enabled=true
    • a default provider like (<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" )

Read Full Post »

Symptoms:

  • You keep getting the exception HRESULT: 0x800708C5 with the Active directory membership provider change password indicating that the password used does not conform to the domain password policy.
  • As an admin, you are able to update the user password using that same password.

 

Probable cause:

  • The active directory policy can be set to allow a “minimum password age”, i.e. users cannot change their own password before it is at least X days (default 1). The Administrator though does not have such restrictions when trying to update a user’s password.
  • This can be checked at Start->Administrative tools->Group policy Management->Navigate the tree to the domain-> default domain policy –>right click edit->computer configuration –>policies –>windows settings->security settings-> account policies->password policy->check the entry for “minimum password age”
  • If you want to reset it (mainly for development/testing purposes), just change it to zero. then go to command line gpupdate /force to apply the new policy

Read Full Post »

Joel Oleson just posted his advice about whether to use SharePoint 2007 now or wait for better features in SharePoint 2010:   http://www.sharepointjoel.com/Lists/Posts/Post.aspx?List=0cd1a63d%2D183c%2D4fc2%2D8320%2Dba5369008acb&ID=302

Read Full Post »

Very useful list by Chris O’Brien: http://www.sharepointnutsandbolts.com/2009/06/my-checklist-for-optimizing-sharepoint.html

Read Full Post »

« Newer Posts - Older Posts »