Skip to content

Instantly share code, notes, and snippets.

View carlgrzywacz's full-sized avatar

CarlGrzywacz carlgrzywacz

  • Microsoft
View GitHub Profile
@carlgrzywacz
carlgrzywacz / Update-IntappWorkspacesWebsiteTabs.ps1
Last active February 13, 2024 18:45
Script to convert Website Tabs referencing Custodian to Intapp Workspaces Tab
#requires -modules "PnP.PowerShell"
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
#Permissions Required:
# AppCatalog.Read.All - Get the Teams App from the Teams App Catalog
# Group.Read.All - Loop through Teams
# TeamsAppInstallation.ReadWriteAndConsentForTeam.All or Group.ReadWrite.All - Install App to Team
# TeamsTab.ReadWrite.All - Add/Remove Tabs to Channels
#requires -Modules @{ ModuleName="PnP.PowerShell"; ModuleVersion="1.4.0" }
$url = "https://2r5lcg.sharepoint.com/sites/PrivateTeam"
#Connect-PnPOnline -Url $Url -Interactive
Connect-PnPOnline `
-Url $url `
-ClientId $env:O365_CLIENTID `
-Thumbprint $env:O365_THUMBPRINT `
-Tenant $env:O365_TENANTID
@carlgrzywacz
carlgrzywacz / Get-PnPFileCoauthoringInfo.ps1
Created January 2, 2024 18:49
Determine if a file is being co-authored
#requires -modules "PnP.PowerShell"
$siteUrl = "https://tenant.sharepoint.com/sites/sitename"
$itemId = 1;
$listName = "Documents";
$sleepTime = 5;
Connect-pnpOnline -Url $siteUrl -Interactive
for (($i = 0); $i -lt 100; $i++)
@carlgrzywacz
carlgrzywacz / New-SPOLargeList.ps1
Created October 12, 2023 15:40
Add 5000 items to an existing list
#requires -Modules @{ ModuleName="PnP.PowerShell"; ModuleVersion="1.4.0" }
$url = "https://tenant.sharepoint.com/sites/SiteName"
$list = "ListName"
Connect-PnPOnline -Url $Url -Interactive
# create 5000+ list items
$itemsToCreate = 5001;
<#
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits, including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
## Please note: None of the conditions outlined
#requires -module "PnP.PowerShell"
<#
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits, including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
## Please no
@carlgrzywacz
carlgrzywacz / Add-SitesDotSelectedPermissionToSite.ps1
Last active May 23, 2023 13:54
Adds Sites.Selected permission to a site for an App ID
#requires -modules "Microsoft.Graph"
<#
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits, including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
## Please
@carlgrzywacz
carlgrzywacz / Add-VivaLearningListMetadata.ps1
Created May 22, 2023 18:32
Add the additional metadata for Viva Learnings since this can be a tedious task for organizations with multiple Learning Content Repositories (https://learn.microsoft.com/en-us/viva/learning/configure-sharepoint-content-source#metadata)
#requires -module "PnP.PowerShell"
<#
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits, including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
## Please no
#requires -module "PnP.PowerShell"
<#
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits, including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
## Please no
@carlgrzywacz
carlgrzywacz / Get-AppsInstalledFromTenantAppCatalog.ps1
Last active May 19, 2023 14:25
Get all apps from the App Catalog installed on a site
<#
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits, including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
## Please note: None of the conditions outlined