View SpectreConsoleTable.psm1
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 New-SpectreConsoleTable | |
{ | |
return New-Object Spectre.Console.Table | |
} | |
function New-SpectreConsoleTableColumn | |
{ | |
[CmdletBinding()] | |
param | |
( |
View redirectmap.config
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
<rewriteMaps> | |
<rewriteMap name="businesssolutions"> | |
<add key="sites/123" value="sites/123"/> | |
<add key="sites/abc" value="sites/abc"/> | |
<add key="sites/abc123" value="sites/abc123"/> | |
</rewriteMap> | |
<rewriteMap name="diversifiedbusiness"> | |
<add key="sites/123" value="sites/123"/> | |
<add key="sites/abc" value="sites/abc"/> | |
<add key="sites/abc123" value="sites/abc123"/> |
View Get-SiteCollectionUserInformationListPrincipal.ps1
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
#requires -modules "PnP.PowerShell" | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 | |
function Get-SiteCollectionUserInformationListPrincipal | |
{ | |
[CmdletBinding()] | |
param |
View Invoke-ListPermissionInheritanceReset.ps1
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
#requires -modules "PnP.PowerShell" | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 | |
function Invoke-FolderPermissionInheritanceReset | |
{ | |
[CmdletBinding()] | |
param | |
( |
View Initialize-SiteCollectionSubWebHierarchy.ps1
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
#requires -modules "PnP.PowerShell" | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 | |
$targetSiteUrl = "https://contoso.sharepoint.com/sites/teamsite" | |
$sourceSiteUrl = "https://sharepoint.2019.contoso.lab/sites/teamsite" | |
$tenantName = $env:O365_TENANT | |
$clientId = $env:O365_CLIENT_ID | |
$certificateThumbprint = $env:O365_THUMBPRINT |
View Disable-SharingForNonOwnersOfSite.ps1
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
#requires -modules "PnP.PowerShell" | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 | |
$clientId = $env:O365_CLIENTID | |
$thumbprint = $env:O365_THUMBPRINT | |
$tenantId = $env:O365_TENANTID | |
$tenant = $env:O365_TENANT |
View Get-TenantSiteOwners.ps1
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
#requires -modules "PnP.PowerShell" | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 | |
$clientId = $env:O365_CLIENTID | |
$thumbprint = $env:O365_THUMBPRINT | |
$tenant = $env:O365_TENANT | |
$includeSCA = $true | |
View Get-SPOSiteIdByUrlViaRest.ps1
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-PnPOnline ` | |
-Url "https://$($env:O365_TENANT)-admin.sharepoint.com" ` | |
-ClientId $env:O365_CLIENTID ` | |
-Thumbprint $env:O365_THUMBPRINT ` | |
-Tenant $env:O365_TENANTID | |
$response = Invoke-PnPSPRestMethod ` | |
-Method POST ` | |
-Url "/_api/web/lists/GetByTitle('DO_NOT_DELETE_SPLIST_TENANTADMIN_ALL_SITES_AGGREGATED_SITECOLLECTIONS')/GetItems(query=@v1)?@v1={ `"ViewXml`" : `"<View><Query><Where><Eq><FieldRef Name='SiteUrl'/><Value Type='TEXT'>https://$($env:O365_TENANT).sharepoint.com/sites/teamsite</Value></Eq></Where></Query><ViewFields><FieldRef Name='SiteUrl'/><FieldRef Name='SiteId'/></ViewFields></View>`" }" ` | |
-Content "" ` |
View New-OneDriveFolderReport.ps1
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
#requires -modules "Microsoft.Graph.Authentication", "Microsoft.Graph.Sites" | |
# required service principal permissions | |
# Graph > Application > Files.Read.All | |
# Graph > Application > Sites.Read.All | |
Connect-MgGraph ` | |
-ClientId $env:O365_CLIENTID ` | |
-CertificateThumbprint $env:O365_THUMBPRINT ` | |
-TenantId $env:O365_TENANTID | Out-Null |
NewerOlder