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
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
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
$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://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
function Enable-CustomLikesRatingsOnLibrary { | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$true)] | |
[Microsoft.SharePoint.Client.Web]$Web, | |
[Parameter(Mandatory=$true)] | |
[String]$ListRelativeUrl | |
) | |
# Get required fields |
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 Exchange Online | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $cred -Authentication Basic -AllowRedirection | |
Import-PSSession $Session | |
# Get current mailbox language settings | |
$Settings = Get-MailboxRegionalConfiguration -Identity $username | |
Write-Host "Before: $($Settings.Language)" |
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)" |
OlderNewer