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
# SERVER SIDE API | |
$web = Get-SPWeb -Identity "https://sharepoint.contoso.com/sites/teamsite" | |
$list = $web.lists.TryGetList( "Choice Field List" ) | |
$field = $list.Fields.GetField( "Pick One") | |
$field.Choices | |
$list.ID | |
# REST API |
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
#Requires -Version 4.0 | |
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop | |
$serverNames = Get-SPServer | ? { $_.Role -ne "Invalid" } | % { $_.Address } | |
workflow Repair-ConfigCache | |
{ | |
param | |
( | |
[parameter(Mandatory=$true)][string[]]$ComputerNames, |
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-Type -Path "C:\Microsoft.SharePointOnline.CSOM.16.1.6008.1200\lib\net45\Microsoft.SharePoint.Client.dll" | |
Add-Type -Path "C:\Microsoft.SharePointOnline.CSOM.16.1.6008.1200\lib\net45\Microsoft.SharePoint.Client.Runtime.dll" | |
Add-Type -Path "C:\Microsoft.SharePointOnline.CSOM.16.1.6008.1200\lib\net45\Microsoft.Online.SharePoint.Client.Tenant.dll" | |
$tenantAdminUrl = "https://contoso-admin.sharepoint.com" | |
$tenantAdminUsername = "admin@contoso.onmicrosoft.com" | |
$securePassword = ConvertTo-SecureString 'pass@word1' -AsPlainText -Force | |
$script:PropertyName = "contoso_SiteDataClassification" | |
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
function Get-NestedGroupMembership | |
{ | |
[cmdletbinding()] | |
param | |
( | |
[parameter(Mandatory=$true)][string]$Cn | |
) | |
begin | |
{ |
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
#Requires -Version 3.0 | |
function Invoke-NonQuery | |
{ | |
[cmdletbinding()] | |
param( | |
[Parameter(Mandatory=$true)][string]$DatabaseName, | |
[Parameter(Mandatory=$true)][string]$DatabaseServer, | |
[Parameter(Mandatory=$true)][string]$Query, | |
[int]$CommandTimeout=30 # The default is 30 seconds |
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
function New-TokenSigningCertificate | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[parameter(Position=0, Mandatory=$true)][string]$CertificateName, | |
[parameter(Position=0, Mandatory=$true)][string]$Path, | |
[parameter(Position=0, Mandatory=$true)][string]$CertificateDomain, | |
[parameter(Position=0, Mandatory=$true)][string]$Password | |
) |
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
function New-ProviderHostedAppRegistration | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[parameter(Position=0, Mandatory=$true)][System.Security.Cryptography.X509Certificates.X509Certificate2]$TokenSigningCertificate, | |
[parameter(Position=0, Mandatory=$true)][string]$TrustedRootAuthorityDisplayName, | |
[parameter(Position=0, Mandatory=$true)][string]$SPTrustedSecurityTokenIssuerDisplayName, | |
[parameter(Position=0, Mandatory=$false)][System.Guid]$IssuerId | |
) |
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
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 | |
$clientId = $env:YammerClientId | |
$accessToken = $env:YammerAccessToken | |
function Get-ResponseFailureInfo | |
{ | |
[cmdletbinding()] | |
param |
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
function Test-FolderPath | |
{ | |
<# | |
.Synopsis | |
This function scans a NTFS directory for file and folder length violations against the URL path length restrictions outlined in | |
the "URL path length restrictions (SharePoint Server 2010)" technet article. The script will create up to three .csv files, | |
each containing respective violation types. The script will also create a fourth .csv that contains all files that will be | |
blocked on upload due to file extension. | |