October 23

SharePoint 2013 On-Site vs Office 365 Cloud

So you have been tasked with choosing between in on-site vs cloud versions of SharePoint.
You have another choice and that is to do both also known as hybrid.

SharePoint 2013 features are the same on-site and in the cloud.

A Forrester Research Inc. survey of IT decision makers shows:

  • 62% (82% in 2010) plan to deploy SharePoint 2013 on-premises
  • 8% (4% in 2010) will do so in a Microsoft datacenter
  • 26% (5% in 2010) will deploy SharePoint in a hybrid mode, both on-premises and cloud

While that shows a clear majority plan to run SharePoint in-house, that number is down from 2010.

Metalogix Software Corporate Survey had similar findings, showing

  • 55% intend to continue running SharePoint entirely in-house
  • 10% plan to run it purely in the cloud.
  • 35% are planning hybrid SharePoint implementations.

Let us look at some business rules that would slant you one way or the other.

Business Rule On-Site Cloud
Company does not want information outside the premises X
Company has users over across multiple continent X
Company is involved in a lot of legal battles X
Company needs to interact with external clients X
Company wants to be use SharePoint as Order Entry System X
Company does not have IT Operational department personal to support SharePoint long term X
Need to connect SharePoint to on-site systems X
Company is moving everything to the “Cloud” X
Company does not have financial resources to take on yearly cloud membership fees X
Company want to increase their mobile access X

Security issues have caused a lot of companies to avoid the cloud. With all the security breaches in the news a lot these days, it easy to see why companies IT Security officers do want anything to do with any cloud based system.

The promise of reduced cost have a lot of company thinking about moving to the cloud, doing research on cloud benefits, or taking the plunge and moving to the cloud.

Comfort level with what you know has caused a lot to go with on-site implementation.

Areas which I have seen that influence the direction are: Comfort, Cost & Legal.
– If a company already has SharePoint on-site and they are upgrading to 2013, they tend to keep it on-site.
– If a company is looking to reduce infrastructure cost, they tend to go with a cloud based solution.
– If a company’s legal department want to control their intellectual properties and assets, they tend to keep it on-site

Category: SharePoint, SharePoint 2013 | Comments Off on SharePoint 2013 On-Site vs Office 365 Cloud
September 11

SharePoint 2010 PowerShell scripts to install Web Parts and Features

For development you can use Visual Studio 2010  features (right click deploy) to install web parts and features, but once you get into testing/staging and production enviornemnts you can use the following script

Web Parts

POWERSHELL-SharePoint-WebPart.ps1

Add-PsSnapin Microsoft.SharePoint.PowerShell

Write-Host "Initializing parameters"
$featureAction=$args[3]
$CurrentDir=$args[0]
$solutionName=$args[1] + ".wsp"
$webpartName=$args[1]
$SolutionPath=$CurrentDir + "\" + $solutionName
$logfile=$CurrentDir + "\" + $webpartName + "_" + $featureAction + ".log"
$urlPath=$args[2]
$installToURL=$args[4]

if (( $urlPath -eq $null) -or ( $installToURL -eq $null ))
{
    $installToURL="No"
}

Write-Host "Logfile: " $logfile " Starting...."
Start-Transcript $logfile

if ( $featureAction -eq "Remove")
{
    Write-Host "Rretracting and uninstalling solution:" $solutionName
    Uninstall-SPSolution -Identity $solutionName  -allwebapplications -Confirm:$false

    Write-Host "Waiting till retaction has finished " -nonewline
    do
    {
        Start-Sleep 2
        Write-Host "." -nonewline
    }
    while ((Get-SPSolution $solutionName).Deployed)

    Start-Sleep 5
    Write-Host "." -nonewline

    Write-Host "Removing solution:" $solutionName " "
    Remove-SPSolution -Identity $solutionName -Confirm:$false

    Write-Host $solutionName " Now Removed!"

}

if ( $featureAction -eq "Install")
{

    Write-Host "Adding solution:" $solutionName " "
    Add-SPSolution $SolutionPath 

    if ( $installToURL -ne "Yes" )
    {
        Write-Host "Deploying solution:" $solutionName "to GAC "
        Install-SPSolution -Identity $solutionName  -AllWebApplications -GACDeployment -CASPolicies -Confirm:$false
    }
    else
    {
        Write-Host "Deploying solution:" $solutionName "to" $urlPath "and GAC "
        Install-SPSolution -Identity $solutionName -WebApplication $urlPath -GACDeployment -Confirm:$false
    }

    Write-Host "Waiting till deployment has finished " -nonewline
    do
    {
        Start-Sleep 2
        Write-Host "." -nonewline
    }
    while ((Get-SPSolution $solutionName).Deployed)

    Start-Sleep 5
    Write-Host "." -nonewline

    Write-Host $solutionName " Now installed!"

}

if ( $featureAction -eq "Update")
{
    Write-Host "Updating solution:" $solutionName " "
    Update-SPSolution -Identity $solutionName -LiteralPath $SolutionPath -GACDeployment -Confirm:$false
    Write-Host $solutionName " Now updated!"
}

Write-Host "" 

Stop-Transcript

Remove-PsSnapin Microsoft.SharePoint.PowerShell
To use POWERSHELL-SharePoint-WebPart.ps1, create dos bat file called
mywebpart-install.bat
@echo off
REM                                                    Current               Site Collection
REM               Script to install webpart            Dir    webpart Name   to Install to       Action (Install, Update, Remove)
REM              ----------------------------------    ------ -------------- ------------------- ------------
powershell -file ".\POWERSHELL-SharePoint-WebPart.ps1" "%CD%" "mywebpart" "http://stage.company.com" "Install"

FEATURES

POWERSHELL-SharePoint-Feature.ps1

Add-PsSnapin Microsoft.SharePoint.PowerShell

Write-Host 'Will initialize parameters'
$CurrentDir=$args[0]
$solutionName=$args[1] + ".wsp"
$featureName=$args[1]
$SolutionPath=$CurrentDir + "\" + $solutionName
$urlPath=$args[2]
$action=$args[3]

$logfile=$CurrentDir + "\" + $args[1] + "_" + $action + ".log"

Write-Host "Logfile: " + $logfile + " Starting...."
Start-Transcript $logfile

$errorActionPreference = 'Inquire'
if ( $action -eq "Remove" )
{
	Write-Host $action ' ' $featureName '....'

	Write-Host 'Will now disable feature, ' $featureName ' for all site in Site Collection in ' $urlPath

	# Get Feature object
	$feature = Get-SPFeature $featureName

	#Get web application
	$webApp = Get-SPWebApplication -Identity $urlPath

	#Deactivate site scoped feature for all site collections in a Web Application (checks to see if the feature is activated before attempting to deactivate)
	Write-Host 'Will now deactivate solution:' $solutionName
	$webApp | Get-SPSite -limit all | ForEach-Object {
    	Write-Host '...Checking Site ' $_.Url ' for ' $solutionName
        if ($_.Features[$feature.ID]) {
            Write-Host '... ...deactiviatng feature ' $solutionName ' from ' $_.Url
            Disable-SPFeature $feature -Url $_.Url -Force -Confirm:$false
		}
	}

    $solution = Get-SPSolution | where-object {$_.Name -eq $solutionName}

	Write-Host 'Will now retract solution:' $solutionName
	Uninstall-SPSolution -Identity $solutionName -Confirm:$false

	#Wait for solution to be uninstalled
    while ($solution.Deployed -eq $true)
    {
        Write-Host '.'  -nonewline
		Start-Sleep -s 1
    }
    #make sure job is finished
    while ( $solution.JobExists )
    {
        write-host '.'  -nonewline
        sleep 1
    }
	write-host ''
	Write-Host 'Will now remove solution:' $solutionName
	Remove-SPSolution -Identity $solutionName -force -Confirm:$false
}

if ( $action -eq "Install")
{

	Write-Host 'Will now add solution:' $solutionName
	Add-SPSolution -LiteralPath $SolutionPath 

	Write-Host 'Will now deploy solution:' $solutionName
	Install-SPSolution -Identity $solutionName -GACDeployment  -force

    $solution = Get-SPSolution | where-object {$_.Name -eq $solutionName}

    while ( $solution.JobExists )
    {
        write-host '.'  -nonewline
        sleep 1
    }
	write-host ''
    write-host 'Solution, ' $solutionName ', ' $action '!'

}

if ( $action -eq "Update")
{
	Write-Host 'Will now update solution:' $solutionName
	Update-SPSolution -Identity $solutionName -LiteralPath $SolutionPath -GACDeployment  -force

    $solution = Get-SPSolution | where-object {$_.Name -eq $solutionName}

    while ( $solution.JobExists )
    {
        write-host '.'  -nonewline
        sleep 1
    }
	write-host ''
    write-host 'Solution, ' $solutionName ', ' $action '!'
}

#place bland line to fix log format
write-host ' '

#Stop Log
Stop-Transcript

#fix output file so it has newlines in notepad
[string]::Join("`r`n",(Get-Content $logfile)) | Out-File $logfile

Remove-PsSnapin Microsoft.SharePoint.PowerShell

To use POWERSHELL-SharePoint-Feature.ps1, create dos bat file called
myFeature-install.bat

@echo off
REM                                                    Current               Site Collection
REM               Script to install feature            Dir    feature Name   to Install to       Action (Install, Update, Remove)
REM              ----------------------------------    ------ -------------- ------------------- ------------
powershell -file ".\POWERSHELL-SharePoint-WebPart.ps1" "%CD%" "myfeature" "http://stage.company.com" "Install"