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-CustomLoadParameter { | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$true)] | |
[Microsoft.SharePoint.Client.ClientObject]$Object, | |
[Parameter(Mandatory=$true)] | |
[string]$PropertyName | |
) | |
# Reference: http://sharepoint.stackexchange.com/questions/126221/spo-retrieve-hasuniqueroleassignements-property-using-powershell |
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 Enable-CustomItemScheduling { | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$true)] | |
[Microsoft.SharePoint.Client.Web]$Web, | |
[Parameter(Mandatory=$true)] | |
[String]$PagesLibraryName | |
) | |
$List = $Web.Lists.GetByTitle($PagesLibraryName) |
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
$Context = Get-SPOContext | |
$Web = $Context.Site.RootWeb | |
$Context.Load($Web) | |
Execute-SPOQuery | |
Enable-CustomItemScheduling -Web $Web -PagesLibraryName "Pages" |
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
# Configuration | |
$WebUrl = "http://intranet.contoso.com" | |
$PageUrl = "/Pages/default.aspx" | |
$WebPartName = "Documents" | |
# Enables export mode | |
$Web = Get-SPWeb $WebUrl | |
$File = $Web.GetFile($Web.ServerRelativeUrl + $PageUrl) | |
$File.CheckOut() | |
$Wpm = $File.GetLimitedWebPartManager([System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared) |
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
# Configuration | |
$WebUrl = "http://teams.contoso.com/sites/team1" | |
$SiteAdminGroup = "CONTOSO\ContosoSiteAdmins" | |
# Set the AD group as site collection administrator | |
$Web = Get-SPWeb $WebUrl | |
$SiteAdminUser = $Web.EnsureUser($SiteAdminGroup) | |
$SiteAdminUser.IsSiteAdmin = $true | |
$SiteAdminUser.Update() |
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
# Connect to SharePoint Online site collection and get context | |
Connect-SPOnline -Url "https://TENANTID.sharepoint.com/sites/news | |
$Context = Get-SPOContext | |
$Web = $Context.Site.RootWeb | |
$Context.Load($Web) | |
Execute-SPOQuery | |
# Enable likes ratings | |
Enable-CustomLikesRatingsOnLibrary -Web $Web -ListRelativeUrl "Pages" |
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
# Settings | |
$Username = "aflyen@northcorp.no" | |
# Connect to Azure AD | |
Connect-AzureAD | |
# Get user | |
$User = Get-AzureADUser -ObjectId $Username | |
Write-Host "Before: $($User.PreferredLanguage)" |
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 addMigrationInfo(sender, args) { | |
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function() { | |
var statusId = SP.UI.Status.addStatus("This site has moved. Please update you bookmarks and visit the new location: <a href='" + url + "'>" + url + "</a>"); | |
SP.UI.Status.setStatusPriColor(statusId, 'yellow'); | |
}); | |
} | |
// Initialize the statusbar as late as possible, see: https://blog.josequinto.com/2015/06/16/custom-javascript-function-loaded-after-the-ui-has-loaded-in-sharepoint-2013/ | |
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(addMigrationInfo); |
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 | |
Restrict Office 365 Groups creation | |
.DESCRIPTION | |
Restrict creation to only users in a specific Azure AD security group. Requires the Azure AD Preview PowerShell module to be installed (this or newer version): https://www.powershellgallery.com/packages/AzureADPreview/2.0.0.98 | |
.NOTES | |
Author : Are Flyen | |
.LINK | |
http://blog.areflyen.no | |
#> |
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
# Configuration | |
$TenantUrl = "https://contoso.sharepoint.com" | |
$Username = "danj@contoso.com" | |
$Password = "Password1" | |
$SiteTitle = "My Communication Site 1" | |
$SiteUrl = "https://contoso.sharepoint.com/sites/mycomsite1" # Note this URL must be available (check with "/_api/GroupSiteManager/GetValidSiteUrlFromAlias") | |
$SiteTemplate = "" # "Topic" => leave empty (default), "Showcase" => "6142d2a0-63a5-4ba0-aede-d9fefca2c767" and "Blank" => "f6cc5403-0d63-442e-96c0-285923709ffc" | |
# Communication site creation request |
OlderNewer