Showing posts with label Powershell. Show all posts
Showing posts with label Powershell. Show all posts

Wednesday, November 18, 2015

Download all Site collection documents / Files using Powershell in specific folder

I updated the script written by "Nico Martens" in below blog post

http://sharepointrelated.com/2014/11/11/download-all-content-in-a-site-collection/

Below script will download all your documents in specific folder of Site and List

Thursday, November 13, 2014

Upload files and sub folder to SharePoint library from local folder using PowerShell

#Task performed in this PowerShell script.
#=============================================================
#Replicate Local folder with subfolder and files in SharePoint document library
#=============================================================
#Prerequisite
#Document Library for uploading files should be alresdy created
#=============================================================
#Author : Satish R Gadekar
#Date   : 11/13/2014
#=============================================================


Tuesday, October 22, 2013

Import / Export List in SharePoint using PowerShell

Exporting SPList :

 Export-SPWeb "<Site URL>" -itemurl "/Lists/<List Name>" -Path "D:\ListFolder\TestExport.cmp"


Importing SPList:

 Import-SPWeb -Identity "<Site URL>" -Path "D:\ListFolder\TestExport.cmp"



It will create list with same name in the target site.

Wednesday, September 25, 2013

Simple PowerShell to get Event Receivers attached to SharePoint list


$spWeb = Get-SPWeb -Identity "SiteUrl"

$spList = $spWeb.Lists["ListName"] 

$spList.EventReceivers | Select Name, Assembly, Type

Friday, May 31, 2013

Warm Up Script for SharePoint

You can use this warm up script after deployment in SharePoint it will bring back your site faster thna browser.


Write below line in text file and save as BAT file


####################################################################
powershell -command "& 'D:\Satish\WarmUp\Satish\WarmUp.ps1'"
####################################################################


Write Below lines in text file and save as ps1 file

Saturday, December 29, 2012

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.(SharePoint 2010 Powershell error)

Error:- "The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered when trying to run SharePoint 2010 PowerShell"

This message would also show up if you try to run the SharePoint 2010 Managment Shell without the proper permissions, or if the account does not have the proper permissions in SQL

OR






the SharePoint 2010 Management Shell was pointing to the incorrect version or path that is invalid and not compatible.
 To Verify which version is being used
1.  Bring up SharePoint 2010 Managment Shell (ignore) the error Message
2.  Type:
$ver=$host | select version
$ver.Version
3.  If you receive something like below.  If the Major version is not on 2, then you will get this runtime error.
Major  Minor  Build  Revision
—–  —–  —–  ——–
3      0      -1     -1
4.  Close out of SharePoint 2010 Managment Shell.
5.  Go back to the SharePoint 2010 Managment Shell Shortcut, right click and select “Properties”
6.  Under the Shortcut tab, Target: section, insert ”-version 2″ into the path, like so.  Make sure its before the -NoExit.
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -version 2 -NoExit ” & ‘ C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ‘ “
7.  Click apply, and then Ok
8.  Reopen up the SharePoint 2010 Managment Shell with admin rights, and you should now no longer receive that error, you should then be able to run your scripts.

Sunday, October 28, 2012

Enable/Disable Developer Dashboard Powershell command SharePoint 2010

Type below commands in Powershell

$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On
$addsetting.Update()


Make it OnDemand


$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand
$addsetting.Update()


Turn Off

$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off
$addsetting.Update()

SharePoint document metadata not updating

I faced a weird issue today, Metadata for document which has lookup column was not updating even after saving the item. There was no erro...