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

Thursday, March 16, 2017

16 Mar

sharepoint Powershell migrate users in a web application

[Microsoft.SharePoint.SPSecurity]::RunWithElevatedPrivileges({param([string]$url = "http://sharepointsite/", `[string]$oldprovider = `"keystoneuser", `[string]$newprovider = `"i:0ǵ.t|keystone sts|radiant\")add-pssnapin microsoft.sharepoint.powershell -EA 0# Get all of the users in a site#$users = get-spuser -web $url...

Monday, February 27, 2017

27 Feb

PowerShell - Event Receivers on SharePoint List

There are times when you want to check which event receivers are attached to a SharePoint list.   This can be easily achieved through use of a PowerShell script. $spWeb = Get-SPWeb Identity http://sharepoint$spList = $spWeb.Lists["My List"] $spList.EventReceivers | Select Name,...
27 Feb

SharePoint 2010 - PowerShell Content Database Backup

“This post details the steps for backing up the content database of a SharePoint site through PowerShell.   view the steps for backing up a content database through Central Administration.” PowerShell provides a means to backup data within SharePoint through the following command: Backup-SPFarm -Directory...

Friday, December 2, 2016

02 Dec

Delete all files & folders from SharePoint library

Add-PSSnapin Microsoft.SharePoint.PowerShell # Replace siteurl with actual web url $web = Get-SPWeb -Identity "siteurl" # Replace docurl with document library url $list = $web.GetList("docurl") function DeleteFiles {     param($folderUrl)     $folder = $web.GetFolder($folderUrl)     foreach...

Monday, October 24, 2016

24 Oct

Fast Site Creation in SharePoint 2016

 Fast Site Collection Creation for a template, Enable-SPWebTemplateForSiteMaster -Template “STS#0” -CompatibilityLevel 15 Let’s get the DB where we have already provisioned a site collection. $DB = Get-SPContentDatabase -site http://peakfinders/sites/fast Now lets create a SiteMaster in it. New-SPSiteMaster...