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
# Download and backup deployed SharePoint solutions from the config database | |
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | |
$dir = "C:\Solutions\" | |
$solutions = Get-SPSolution | |
if(!$solutions){ | |
write-host "No solutions found." -foregroundcolor Red | |
}else{ |
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 Remove-SPQuickLaunchLinks{ | |
Param( | |
[parameter(Mandatory=$true)] | |
[String] | |
$url | |
) | |
$SPWeb = Get-SPWeb $url | |
$QuickLaunch = $SPWeb.Navigation.QuickLaunch | |
$Nodes = @() |
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
## The following four lines only need to be declared once in your script. | |
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes","Description." | |
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No","Description." | |
$cancel = New-Object System.Management.Automation.Host.ChoiceDescription "&Cancel","Description." | |
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no, $cancel) | |
## Use the following each time your want to prompt the use | |
$title = "Title" | |
$message = "Question?" | |
$result = $host.ui.PromptForChoice($title, $message, $options, 1) |
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
# Administer managed paths in SharePoint using PowerShell. | |
# https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/get-spmanagedpath?view=sharepoint-ps | |
# Get managed paths | |
Get-SPManagedPath -WebApplication https://sharepoint.jcallaghan.com | |
## New explicit managed path | |
New-SPManagedPath -RelativeURL "projectsdirectory" -Explicit -WebApplication https://sharepoint.jcallaghan.com | |
## New wildcard managed path |
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 | |
Easily replace the current homepage with an alternative page you have created. | |
.DESCRIPTION | |
This function changes the name of the current homepage and renames a page to Home.aspx. | |
The script currently only works when the homepage is /sitepages/home.aspx. | |
It does of course assume the current homepage is Home.aspx. The welcome page URL is case sensitive. | |
A switch to remove the previous homepage rather than rename it is also included. | |
.EXAMPLE | |
Set-NewHomepage -siteurl https://demo.sharepoint.com/sites/intranet -pagerelativeurl /sitepages/newhome1.aspx -removeprevious:$false |
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
{ | |
"headerEmphasis":null, | |
"themeKey":null, | |
"name":"SharePoint Hub Site", | |
"url":"https://[tenant].sharepoint.com/sites/[site]", | |
"logoUrl":null, | |
"usesMetadataNavigation":false, | |
"megaMenuEnabled":true, | |
"navigation":[{ | |
"Id":2004, |