PowerShell

Error occurred in deployment step ‘Recycle IIS Application Pool’: The local SharePoint server is not available.

For security and availability purposes we’ve moved away from using the SharePoint Farm account for development. Adding new devs to your farm can be pretty simple if you know what tools to use. Frist, I always add my devs to the local admin group. Second you need to run the following commands. This adds the domain user to the appropriate roles Get-SPDatabase | Where-Object {$_.WebApplication -like “SPAdministrationWebApplication”} | Add-SPShellAdmin domain\username…

VS2012Logo

Visual Studio SharePoint List Rich HTML Field

I couldn’t figure out how to add Rich HTML field to a List I was deploying in a project. I searched MSDN, it’s literary reference for the Type property was “DataType”. I threw my hands up. I remembered a trick I used somewhere else when I creating site templates though. So I went to SharePoint. Created a quick list and Added the field I wanted. I Saved the field as…

SharePoint 2013 place holder

SharePoint 2013 Modal Dialogs that work.

Customer request modal dialogs from time to time in their applications. We use Twitter Bootstrap pretty heavy but sometimes we don’t have complete control over the JavaScript Framework. In those cases you’re forced to use the OOB SharePoint Modal implementation. The default SharePoint Master Page(s) do not include a reference to SP.UI.Modal.js. You can add the reference in the master page but then it loads on every page. New to…

SharePoint 2013 place holder

SharePoint – Save Site As Template Missing ?

Site Templates don’t work on publishing sites, there are many reasons for this, master pages, page layouts, etc. The stuff doesn’t export / Import well. Some times you need just need to get to the site template for development reasons and what not. This is stolen from the link below So, what worked for me is much simpler: 1. In the site that you need to save go to Site…

SharePoint 2013 place holder

SharePoint call javascript after page load with Script Editor WebPart

In SharePoint 2013 they added a Script Editor WebPart. Add this to a page and add the following code in the WebPart Editor. <SCRIPT LAGUAGE="Javascript"> _spBodyOnLoadFunctionNames.push("color"); function color() { var colorCode = document.getElementsByTagName("td"); var i = 0; for (i = 0; i < colorCode.length; i++) { if (colorCode[i].className == "ms-cellstyle ms-vb2") { if (colorCode[i].innerHTML == "Green") { colorCode[i].style.color = 'Green'; } if (colorCode[i].innerHTML == "Yellow") { colorCode[i].style.color = 'Yellow'; }…

VS2012Logo

Upgrade SharePoint 2010 webpart solution to 2013

Open Visual Studio 2012. Go to File-Open-Project/Solution, locate the file you want to upgrade. (let it do the normal upgrade) Close the project and save changes. Open the *.csproj file in Notepad or some other type of text editor. Change the TargetFrameWorkVersion element from v3.5 to v4.5 <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> Add the TargetOfficeVersion element below the TargetFrameworkVersion element <TargetOfficeVersion>15.0</TargetOfficeVersion> Save the file and open the project again in Visual Studio 2012…

PowerShell

Powershell – Get Site Template ID

The following PowerShell script will return Template Name and the Internal ID. $url = “http://sp2013/” $site= new-Object Microsoft.SharePoint.SPSite($url ) $loc= [System.Int32]::Parse(1033) $templates= $site.GetWebTemplates($loc) foreach ($child in $templates){ write-host $child.Name “ ” $child.Title}

windows-broken-mini

Error – Directory “FeatureDirectoryName” associated with feature ‘GUID1’ in the solution is used by feature ‘GUID2’ installed in the farm.

The solution cannot be deployed. Directory “FeatureDirectoryName” associated with feature ‘GUID1’ in the solution is used by feature ‘GUID2’ installed in the farm. All features must have unique directories to avoid overwriting files. I’ve ran into this error three times now. It happens when you create two projects with the same name. This error can happen when you have two solutions with the same name, one of the solutions has…

windows-broken-mini

SharePoint 2013, The timer job for this operation has been created, but it will fail because the administrative service for this server is not enabled.

The timer job for this operation has been created, but it will fail because the administrative service for this server is not enabled. If the timer job is scheduled to run at a later time, you can run the jobs all at once using stsadm.exe -o execadmsvcjobs. To avoid this problem in the future, enable the Microsoft SharePoint Foundation administrative service, or run your operation through the STSADM.exe command line…