
[SPS] Well-Known SPS URLs
I know this is an old (and known) one, but I thought I should also post a list of my own…. So, here goes:
I know this is an old (and known) one, but I thought I should also post a list of my own…. So, here goes:
Ever wanted to set a tasks list to send e-mail when ownership is assigned using PowerShell? Here’s a way to do it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
#Clear the Screen clear #Load SharePoint PowerShell if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -EA SilentlyContinue) -eq $null) { Write-Host "Loading the SharePoint PowerShell snapin..." Add-PSSnapin Microsoft.SharePoint.PowerShell } #Get All Site Collections $sites=get-spsite -Limit All #Get All webs $webs=$sites.AllWebs #Cycle Through Each SPList and search for List Template foreach ($list in $webs.lists) { if($list.BaseTemplate -eq "TasksWithTimelineAndHierarchy") { Write-Host "Task List Found With the Following Email: Properties" -ForegroundColor Green $list.Title, $list.enableAssignToEmail #Ask for user input for changing the settings of the list $opt=Read-Host "Do you want set the Tasks lists to Send e-mail when ownership is assigned? (Y/N)" switch ($opt) { # Case Change to Enable Y { Write-Host "Yes" $list.EnableAssignToEmail =$true $list.Update() Write-Host $list.Title is now enabled to send e-mails when ownership is assigned. } #Case Change to Disable N { Write-Host "No" $list.EnableAssignToEmail =$false $list.Update() Write-Host $list.Title is now disabled to send e-mails when ownership is assigned. } } } } |
So, here’s a way to export all the Apps/Add-Ins installed on your SharePoint farm. The files will be exported as *.app:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
### Export SharePoint Apps/Add-Ins #### #Load SharePoint PowerShell if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -EA SilentlyContinue) -eq $null) { Write-Host "Loading the SharePoint PowerShell snapin..." Add-PSSnapin Microsoft.SharePoint.PowerShell } Write-Host "Exporting SharePoint Apps/Add-ins" # Preparation: (re)create folder named after the current date to collect all customizations $foldername = (Get-Date -Format "yyyyMMdd").ToString() rmdir $foldername -Recurse -ErrorAction SilentlyContinue $basePath = (mkdir $foldername).FullName # Collect all disposable objects Start-SPAssignment -Global #Save all SharePoint Apps $appPath = (mkdir($basePath +"\Apps")).FullName Write-Host " Saving Apps to $appPath" # Get all accessible SharePoint webs in the farm Get-SPSite -Limit All -WarningAction SilentlyContinue | Get-SPWeb -Limit All -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | % { Write-Host " $($_.Url)..." -NoNewline try{ $instances = Get-SPAppInstance -Web $_.Url if($instances.Count -gt 0) { Write-Host -ForegroundColor Green $instances.Count # create subfolder for web with safe folder name removing the protocol and special chars $subfolder = [RegEx]::Replace($_.Url.Substring($_.url.IndexOf(":")+3), "[{0}]" -f ([RegEx]::Escape([String][System.IO.Path]::GetInvalidFileNameChars())), '') $webPath = (mkdir ($appPath +"\"+ $subfolder)).FullName # export all apps foreach ($instance in $instances) { # create safe file name $filename = [RegEx]::Replace($instance.Title, "[{0}]" -f ([RegEx]::Escape([String][System.IO.Path]::GetInvalidFileNameChars())), '')+".app" Write-Host " $filename..." -NoNewline try{ Export-SPAppPackage -App $instance.App -Path ($webPath + "\"+ $filename) Write-Host -ForegroundColor Green "Done" } catch{ Write-Host -ForegroundColor Red "Failed" Write-Error $_.Exception.Message; } } } else{ Write-Host "None" } } catch{ Write-Host -ForegroundColor Red "Failed" Write-Error $_.Exception.Message; } } #Cleanup disposable objects Stop-SPAssignment -Global Write-Host "Finished" |
You should […]
Copyright © 2025 | PhoeNIXBird Networks