This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= | |
# Script: Clear-SPListItems.ps1 | |
# | |
# Author: Pete Skelly | |
# Twitter: ThreeWillLabs | |
# http://www.threewill.com | |
# | |
# Description: Purge list in Sharepoint Online - Office 365 using CSOM by | |
# batching CSOM calls to simulate SPWeb.ProcessBatchData(). | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= | |
# Script: Add-SPListItemsFromCSV.ps1 | |
# | |
# Author: Pete Skelly | |
# Twitter: ThreeWillLabs | |
# http://www.threewill.com | |
# | |
# Description: Add list items to SharePoint Online - Office 365 List using CSOM from CSV file. | |
# | |
# WARNING: Script provided AS IS with no warranty. Your mileage will vary. Use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($clean) | |
{ | |
$deletedSharedDocs = $false; | |
Write-Host "`n`nCleaning all lists of all content...Please wait" | |
foreach($activity in $activities) | |
{ | |
$web = get-web $activity.RootUrl | |
$list = $web.Lists[$activity.ListName]; | |
\ if ($list.BaseType -eq "DocumentLibrary" -and ($list.ItemCount -gt 0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) | |
##Developer Tools | |
#cinst sysinternals | |
#cinst 7zip | |
cinst diffmerge | |
#cinst winmerge | |
#cinst fiddler | |
#cinst paint.net | |
#cinst githubforwindows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= | |
# Script: TW-CreateBlankClientExtranetSite.ps1 | |
# | |
# Author: Pete Skelly | |
# Twitter: ThreeWillLabs | |
# http://www.threewill.com | |
# | |
# Description: Add a blank site collection to an Office 365 tenant in SharePoint Online | |
# | |
# WARNING: Script provided AS IS with no warranty. Your mileage will vary. Use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction "SilentlyContinue" | |
cls | |
Set-Alias -Name stsadm -Value $env:CommonProgramFiles”\Microsoft Shared\Web Server Extensions\15\BIN\STSADM.EXE” | |
function RemoveOrphanedSites([string]$WebAppUrl, [switch]$ReportOnly) | |
{ | |
$configDB = Get-SPDatabase | where {$_.typename -eq "Configuration Database"} | |
$contentDBs = Get-SPWebApplication -IncludeCentralAdministration | Get-SPContentDatabase | |
foreach($contentDB in $contentDBs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Logout</title> | |
</head> | |
<!-- See http://blog.credera.com/technology-insights/microsoft-solutions/how-to-sign-in-as-a-different-user-in-sharepoint-2013/ for original script--> | |
<body> | |
<a href="javascript: | |
(function() | |
{ | |
if (typeof SP !== 'undefined') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Adds a Google Analytics script to all /teams/* site collections in an Office | |
365 Tenant. | |
.DESCRIPTION | |
When using Office 365 "/teams/*" managed path site collections as an extranet, some | |
clients would like to track their traffic using Google Analytics. This is a | |
simple script that adds the Google Analytics script to a UserCustomAction | |
using the http://github.com/officedev.pnp PowerShell cmdlet's to manage SharePoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. .\TopOfScript_PSCSOM.ps1 | |
function listEventReceivers([Microsoft.SharePoint.Client.ClientContext]$context, [string]$listName) | |
{ | |
Write-Host "Attempting to iterate event receivers on list '$listName'" | |
$list = $context.Web.Lists.GetByTitle($listName); | |
$context.Load($list) | |
$eventReceivers = $list.EventReceivers | |
$context.Load($eventReceivers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string ToCsv<T>(string separator, IEnumerable<T> objectlist) | |
{ | |
Type t = typeof(T); | |
FieldInfo[] fields = t.GetFields(); | |
string header = String.Join(separator, fields.Select(f => f.Name).ToArray()); | |
StringBuilder csvdata = new StringBuilder(); | |
csvdata.AppendLine(header); |
OlderNewer