Friday, 17 March 2017

Uninstalling app in SharePoint Online

This post will guide you on how to uninstall app in SharePoint Online.
For installing any app you can install it from SharePoint APP Store.

So lets get started :)

We have one and only pre-requisite for this that you must have SharePoint Online Client Components SDK installed on the system.

Now we have to get the APP instance ID. Follow below steps to get the ID.

1. Go to the site collection where app is installed
2. Go to Site setting and click a link for an App > Click Details menu item.
3. Now from URL we can get the instance ID

https://sharepoint.com/_layouts/15/appstore.aspx?AppInstanceId=<AppInstanceId>

 Use below script to uninstall the App in SharePoint Online.


[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")

Function Get-ClientContext([string]$Url,[string]$UserName,[string]$Password)

{   $context = New-Object Microsoft.SharePoint.Client.ClientContext($Url)

   $context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName, $Password)
   return $context

}

Function Uninstall-AppInstance([Microsoft.SharePoint.Client.ClientContext]$Context,[Guid]$AppInstanceId)

{   $appInst = $Context.Web.GetAppInstanceById($AppInstanceId)

   $appInst.Uninstall()

   $context.ExecuteQuery()

 }

$UserName = "rahul.dagar@sharepoint.com"

$Password=Read-Host -Prompt "Password" -AsSecureString;

$Url = "https://App.sharepoint.com"

$AppInstanceid = New-Object Guid("APP INSTANCE ID")

$context = Get-ClientContext -Url $Url -UserName $UserName -Password $Password

Uninstall-AppInstance -Context $context -AppInstanceId $AppInstanceid

$context.Dispose()

Also you can check below script
https://gallery.technet.microsoft.com/office/Uninstall-unwanted-app-f18b39c0 

Hope it helps:)

Happy SharePointing :)

Thursday, 9 March 2017

Install and Uninstall SharePoint 2013 Apps using PowerShell.


This post will discuss how to install and uninstall the Apps in SharePoint 2013 On-Premise. I will create another post which will cover SharePoint Online.

So lets get started :)

Installing of Apps in SharePoint 2013


First thing we need to do is to import the app package file to our site collection.

Powershell to import it.


$App = Import-SPAppPackage -Path "C:\Rahul\App.app" -Site "http://Sharepoint2013" –Source ObjectModel

Source: can be Marketplace or CorporateCatalog, DeveloperSite, ObjectModel etc.
 
Now, we will install the app in site
 
Install-SPApp -Web http://Sharepoint2013/site -Identity $App

So Powershell script to install will be like:

$App = Import-SPAppPackage -Path "C:\Rahul\App.app" -Site "http://Sharepoint2013" –Source ObjectModel
Install-SPApp -Web http://Sharepoint2013/site -Identity $App
 

Uninstalling of Apps in SharePoint 2013 


For Uninstalling any app first we need to app from the site and after that we can uninstall it.

So Powershell script to uninstall will be like: 

$installapp = Get-SPAppInstance -web http://Sharepoint2013/site | Where-Object { $_.Title -eq "App" }
Uninstall-SPAppInstance -Identity $installapp 

Hope it helps:)

Happy SharePointing :)






 


 


Monday, 6 March 2017

Create Site Collection 2010 experience in SharePoint 2013 - Part 2

 In previous post we create Site Collection 2010 experience in SharePoint 2013 using GUI below is the link for that Post

1st Method GUI

In this post we will shed some light on 2nd Method which is PowerShell.

So lets get started.

Below is the Powershell cmd which will help to create the Site collection with 2010 look and feel in SharePoint 2013

New-SPSite -Url "http://sp-test:6001/sites/test1" -OwnerAlias "SPFarm" -CompatibilityLevel "14" -ContentDatabase "WSS_Content_Support_6001" -Template "STS#0"



Compatibility level will choose your experience if you write 15 then it will pick 2013 look and feel.

Template i used is Team site. You can choose according to your requirement. Below is the link with template code

List of Template in SharePoint  

My site collection is created with 2010 experience in SharePoint 2013

Hope it helps:)

Happy SharePointing :)

Create Site Collection 2010 experience in SharePoint 2013


One of our users comes with request. Can we have site collection with a Look and Feel like SharePoint 2010 in 2013.

So in order to achieve the above request we have two way to do both very simple and straight forward.

1st using GUI and 2nd using Power-Shell

So lets start with 1st method using GUI.

Steps:

1. Open Central Admin ---> Application management --> Create new site collection.





2. New window will open, select the web application under which you want to create a new site collection.

3. Fill in the required details like title,description, url etc and in Template selection drop down select 2010 and click OK



4. It will take sometime to create a new site collection but once down and when browse to the site collection. You can see that you site collection has a look and feel of 2010.





In other post we will use the 2nd method to create a site collection using 2010 look and feel.

Hope it helps:)

Happy SharePointing :)




Tuesday, 28 February 2017

Installation of the package failed while installing CU on SharePoint 2013

This applies to SharePoint 2010 and 2013.

ISSUE:


While installing the CU on SharePoint 2013 server got below error.

It says"The installation of this package failed"


CAUSE:


1. Missing cab files, all the files cab and exe file should be in same folder.

2. Also check the size of the files that you downloaded and double check with Microsoft site.

3. Above two are not the reason for failure. Then check the name of your cab file, it should be like ubserv_1.cab or ubserv_2.cab it cannot be ubserv_1(1).cab or ubserv_2(1).cab. This can also cause installation failure.

4. Download the CU again from the microsoft site.

Hope it helps.

Happy SharePointing :) 


Thursday, 16 February 2017

Common Question : Difference between Service Pack and Cummulative Updates

 This post will help you out with most common question that a SharePoint techie needs to know.

Difference between Service Pack and Cumulative Updates (CU).

Some of you might don't know but we also have Public Update knows as PU and Critical on demand fix know as COD

So we instead of just talking about difference between Service Pack and CU

We will talk about Service Pack vs CU vs PU vs COD

there are other guys who have answered this question i just wanted to throw my hat in the ring ;)

Lets get started.

Service Pack

 

A Service Pack is combination of all the previously released fixes and potentially any new feature added to SharePoint till date.
It includes new fixes, new functionality and all the older released Service packs and fixes.
It doesn't comes with language pack you have to install a separate service pack for language installed in SharePoint.
There is no release cycle for service pack.

Cumulative Updates

 

A Cumulative update includes fixes for the bug or problem with SharePoint that are reported by users or customers.
It contains all new and previously released CU and PU.
CU comes with language pack so no need to install separate CU for language installed in SharePoint.
Since July 2014, CU has been release every month.

Public Update (PU)


Public Update basically includes security fixes and fixes for the problems that are reported by large number of customers or users
What it includes you have to review the KB article while downloading the PU from Microsoft.
PU also comes with language pack. It will  release once in a month if required.

Critical on demand fix (COD)

 

A COD is a fix which is provided only to a small number of customers affected by a critical problem directly through Microsoft Support.
It includes specific fix for a specific issue. Doesn't come with language pack.
It is only released On Demand 

Hope this article gives you more clear picture about Service Pack, CU, PU and COD.

Happy SharePointing :)







Wednesday, 1 February 2017

Ports required for SharePoint


I recently had project to migrate SharePoint 2010 from old server to a new server.

It was just Server migration not SharePoint Migration.

My networking team doesn't know how to find the Ports which should be opened in new server to communicate with each other and for all other important Sharepoint Functionality to work.

So i prepared a list of port number which are required for my SharePoint Farm.

My SharePoint Farm consists of:

1. 2 Application servers
2. 2 Web Front End servers
3. 1 SQL servers
4. Domain controllers.

Below is the list of port required to be open on new servers.




Hope this helps you :)

Happy SharePointing :)