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
$wpManager = $file.GetLimitedWebPartManager([Microsoft.SharePoint.Client.WebParts.PersonalizationScope]::Shared) | |
$webparts = $wpManager.Webparts | |
$clientContext.Load($webparts) | |
$clientContext.ExecuteQuery() | |
if($webparts.Count -gt 0){ | |
Write-Host "Looping through all webparts" | |
foreach($webpart in $webparts){ | |
$clientContext.Load($webpart.WebPart.Properties) | |
$clientContext.ExecuteQuery() |
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
using (SPSite site = new SPSite(SPContext.Current.Web.Url)) | |
{ | |
using (SPWeb web = site.OpenWeb()) | |
{ | |
web.AllowUnsafeUpdates = true; | |
SPList list = web.Lists["Shared Documents"]; | |
SPListItemCollection items = list.Items; | |
SPListItemCollection oListCollection = list.Items; | |
foreach (SPListItem oListItem in oListCollection) | |
{ |
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
# Variables | |
$tenant = "tenant" | |
$adminUrl = "https://" + $tenant + "-admin.sharepoint.com" | |
$baseUrl = "https://" + $tenant + ".sharepoint.com" | |
$registerUrl = $baseUrl + "/sites/sitealias" | |
$registerListName = "Site Register" | |
$path = "C:\path\LegacyDataSites.csv" | |
$csv = Import-csv -path $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
# Yammer app developer token | |
$token = "" | |
# Base Yammer API url | |
$yammerBaseUrl = "https://www.yammer.com/api/v1" | |
# Reference - Yammer Group | |
#$createGroupUri = "https://www.yammer.com/api/v1/groups.json?name=Example&private=True" | |
function Get-BaererToken() { |
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
# Yammer app developer token | |
$token = "" | |
# Base Yammer API url | |
$yammerBaseUrl = "https://www.yammer.com/api/v1" | |
# Reference - Yammer Group | |
#$createGroupUri = "https://www.yammer.com/api/v1/groups.json?name=Example&private=True" | |
function Get-BaererToken() { |
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
# Get Hub sites | |
Connect-SPOService -Url "https://[tenant]-admin.sharepoint.com" | |
$spoHubSites = Get-SPOHubSite | |
foreach($hub in $spoHubSites){ | |
$hubSiteId = $hub.SiteId | |
Write-Host "$($hub.Title) ($($hub.SiteUrl))" -ForegroundColor Yellow | |
$spoSites = Get-SPOSite -Limit All | |
foreach ($site in $spoSites) { | |
$siteDetailed = Get-SPOSite -Detailed $site.Url |
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
<# | |
# Reference | |
Teams PowerShell - https://docs.microsoft.com/en-us/powershell/module/teams/?view=teams-ps | |
Add-TeamsUser - https://docs.microsoft.com/en-us/powershell/module/teams/add-teamuser?view=teams-ps | |
# PowerShell Module | |
Find-Module MicrosoftTeams | |
Install-Module MicrosoftTeams | |
Get-Command –Module MicrosoftTeams |
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, |
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
$username = "username@tenant.onmicrosoft.com" | |
$securePassword = Read-Host -Prompt "Enter password" -AsSecureString | |
$SecurePassword = $securePassword | ConvertTo-SecureString -AsPlainText -Force | |
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" | |
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" | |
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll" | |
function Connect-SPO{ | |
Param( |
OlderNewer