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
// ---------------------------------------------- | |
// Author: Romain Blanchard | |
// Date: 21.01.2014 | |
// Description: Get SharePoint item (SPListItem) using CAML from column's name. | |
// ---------------------------------------------- | |
SPList Library = web.Lists[<ListName>]; | |
SPQuery ItemQuery = new SPQuery(); | |
ItemQuery.Query = "<Where><Eq><FieldRef Name=\"<ColumnName>\" /><Value Type='Text'>" + <Value> + "</Value></Eq></Where>"; | |
SPListItemCollection ListItemCollection = Library.GetItems(ItemQuery); |
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
# ---------------------------------------------- | |
# Author: Romain Blanchard | |
# Date: 04.02.2014 | |
# Description: Send email with PowerShell | |
# ---------------------------------------------- | |
$serveur = "RBLA-SP2010-001.RBLA.com" | |
$expediteur = "romain@RBLA-SP2010-001.RBLA.com" | |
$destinataire = "test@RBLA-SP2010-001.RBLA.com" | |
$fichier = "D:\fichier.txt" |
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
# ---------------------------------------------- | |
# Author: Romain Blanchard | |
# Date: 06.02.2014 | |
# Description: Delete all site collection in Web Application. | |
# ---------------------------------------------- | |
$webappurl = "http://rbla-sp2010-001:81" | |
$webapp = Get-SPWebApplication $webappurl | |
foreach ($sites in $webapp.Sites) | |
{ |
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
# ---------------------------------------------- | |
# Author: Romain Blanchard | |
# Date: 12.02.2014 | |
# Description: Create x documents. Perfect to create sample document. | |
# ---------------------------------------------- | |
01..50 | % { New-Item "Document$_.docx" -Value (Get-Date).toString() -itemType file} |
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
// ---------------------------------------------- | |
// Author: Romain Blanchard | |
// Date: 20.02.2014 | |
// Description: Get SPWeb properties (property bag) using Javascript. | |
// ---------------------------------------------- | |
//Execute le script au chargement de la page, juste après le sp.js | |
ExecuteOrDelayUntilScriptLoaded(getAllWebProperty, "SP.js"); | |
var properties; |
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
# ---------------------------------------------- | |
# Author: Microsoft | |
# Date: 27.02.2014 | |
# Description: Import termset from CSV file. | |
# ---------------------------------------------- | |
function ImportTermSet([Microsoft.SharePoint.Taxonomy.TermStore]$store, [string]$groupName, [PSCustomObject]$termSet) { | |
function ImportTerm([Microsoft.SharePoint.Taxonomy.Group]$group, | |
[Microsoft.SharePoint.Taxonomy.TermSet]$set, | |
[Microsoft.SharePoint.Taxonomy.Term]$parent, |
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
# ---------------------------------------------- | |
# Author: Romain Blanchard | |
# Date: 04.02.2015 | |
# Description: This script remove / add / update permissions of folders and libraries. | |
# ---------------------------------------------- | |
# Parameters | |
param( | |
[parameter(Mandatory = $true)] | |
[ValidateNotNullOrEmpty()] |
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
# ---------------------------------------------- | |
# Author: Romain Blanchard | |
# Date: 29.03.2013 | |
# Description: Copy account's (users and groups), to an other site. Edit login's prefix part in the same time. | |
# ---------------------------------------------- | |
## Import Powershell module if the script is launched from normal powershell commandline | |
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue | |
## Function that reads the INI configuration file |
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
# ---------------------------------------------- | |
# Author: Romain Blanchard | |
# Date: 20.06.2012 | |
# Description: Get all pages located in "Pages" library and change theirs page layout. | |
# ---------------------------------------------- | |
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue | |
# Variables |
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
# ---------------------------------------------- | |
# Author: Microsoft | |
# Date: 09.10.2013 | |
# Description: Export all termsets from all groups into CSV files. | |
# ---------------------------------------------- | |
$siteUrl = "<Enter URL of Central Administration>" | |
$outputDir = "<Enter export output path>" | |
OlderNewer