Skip to content

Instantly share code, notes, and snippets.

@glapointe
glapointe / Get-SPControlElement.ps1
Created Jan 19, 2017
Retrieves the control elements registered for a given delegate control ID.
View Get-SPControlElement.ps1
<#
.Synopsis
Retrieves the control elements registered for a given delegate control ID.
.DESCRIPTION
Retrieves the control elements registered for a given delegate control ID.
.EXAMPLE
Get-SPControlElement -Web "http://demo" -ControlId "QuickLaunchDataSource" -TopOnly
.EXAMPLE
Get-SPControlElement -Web "http://demo" -ControlId "QuickLaunchDataSource" -Scope "Web"
#>
View Get-SPUserEffectivePermissions.ps1
function Get-SPUserEffectivePermissions() {
[CmdletBinding(DefaultParameterSetName="Farm")]
param (
[Parameter(Mandatory=$true, Position=0)]
[ValidateNotNull()]
[object[]]$users,
[Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=1)]
[ValidateNotNull()]
[Microsoft.SharePoint.SPSecurableObject]$InputObject
@glapointe
glapointe / Custom Windows PowerShell Function to Make SharePoint REST Service Calls (Alternate Version)
Last active Aug 29, 2015
Sends an HTTP or HTTPS request to a SharePoint Online REST-compliant web service using Windows PowerShell.
View Custom Windows PowerShell Function to Make SharePoint REST Service Calls (Alternate Version)
The functions in this Gist are part of an article series on ITUnity.com.
@glapointe
glapointe / Custom Windows PowerShell Function to Make SharePoint REST Service Calls
Last active Apr 9, 2018
Sends an HTTP or HTTPS request to a SharePoint Online REST-compliant web service using Windows PowerShell.
View Custom Windows PowerShell Function to Make SharePoint REST Service Calls
The functions in this Gist are part of an article series on ITUnity.com.
@glapointe
glapointe / Connect-SPOSite.ps1
Created Mar 31, 2015
Utility function for connecting to a SharePoint Online Site Collection using the SharePoint CSOM API and PowerShell.
View Connect-SPOSite.ps1
function global:Connect-SPOSite {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0)]
$Url
)
begin {
[System.Reflection.Assembly]::LoadFile("C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll") | Out-Null
[System.Reflection.Assembly]::LoadFile("C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.Runtime.dll") | Out-Null
@glapointe
glapointe / Load-CSOMProperties.ps1
Created Mar 31, 2015
Utility PowerShell function that facilitates the loading of specific properties of a Microsoft.SharePoint.Client.ClientObject object or Microsoft.SharePoint.Client.ClientObjectCollection object.
View Load-CSOMProperties.ps1
<#
.Synopsis
Facilitates the loading of specific properties of a Microsoft.SharePoint.Client.ClientObject object or Microsoft.SharePoint.Client.ClientObjectCollection object.
.DESCRIPTION
Replicates what you would do with a lambda expression in C#.
For example, "ctx.Load(list, l => list.Title, l => list.Id)" becomes
"Load-CSOMProperties -object $list -propertyNames @('Title', 'Id')".
.EXAMPLE
Load-CSOMProperties -parentObject $web -collectionObject $web.Fields -propertyNames @("InternalName", "Id") -parentPropertyName "Fields" -executeQuery
$web.Fields | select InternalName, Id
You can’t perform that action at this time.