This file contains hidden or 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
#Parameters | |
$tenantUrl = Read-Host -Prompt "Enter tenant collection URL"; | |
$dateTime = (Get-Date).toString("dd-MM-yyyy-hh-ss") | |
$invocation = (Get-Variable MyInvocation).Value | |
$directorypath = Split-Path $invocation.MyCommand.Path | |
$fileName = "SharedLinks-" + $dateTime + ".csv" | |
$ReportOutput = $directorypath + "\Logs\"+ $fileName | |
#Connect to PnP Online |
This file contains hidden or 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
#Parameters | |
$tenantUrl = Read-Host -Prompt "Enter tenant collection URL"; | |
$dateTime = (Get-Date).toString("dd-MM-yyyy-hh-ss") | |
$invocation = (Get-Variable MyInvocation).Value | |
$directorypath = Split-Path $invocation.MyCommand.Path | |
$fileName = "SharedLinks_REST-" + $dateTime + ".csv" | |
$ReportOutput = $directorypath + "\Logs\"+ $fileName | |
# Ensure the logs folder exists |
This file contains hidden or 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
#Parameters | |
$tenantUrl = Read-Host -Prompt "Enter tenant collection URL"; | |
$dateTime = (Get-Date).toString("dd-MM-yyyy-hh-ss") | |
$invocation = (Get-Variable MyInvocation).Value | |
$directorypath = Split-Path $invocation.MyCommand.Path | |
$fileName = "SharedLinks-" + $dateTime + ".csv" | |
$ReportOutput = $directorypath + "\Logs\"+ $fileName | |
#Connect to PnP Online | |
Connect-PnPOnline -Url $tenantUrl -Interactive |
This file contains hidden or 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
Clear-Host | |
$properties=@{SiteUrl='';SiteTitle='';ListTitle='';SensitivityLabel='';Type='';RelativeUrl='';ParentGroup='';MemberType='';MemberName='';MemberLoginName='';Roles='';}; | |
$dateTime = (Get-Date).toString("dd-MM-yyyy-hh-ss") | |
$invocation = (Get-Variable MyInvocation).Value | |
$directorypath = (Split-Path $invocation.MyCommand.Path) + "\Logs\" | |
$excludeLimitedAccess = $true; | |
$includeListsItems = $true; |
This file contains hidden or 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
Public Function StripHTML(ByVal sInput As String) As String | |
IF sInput IsNot Nothing Then | |
IF(sInput <>"") Then | |
Dim objRegExp AS NEW System.Text.RegularExpressions.Regex("<(.|\n)+?>") | |
sInput = Replace(sInput, "<BR>", Chr(10)) | |
sInput = Replace(sInput, "<br>", Chr(10)) | |
sInput = Replace(sInput, "<br/>", Chr(10)) | |
sInput = Replace(sInput," ", " ") | |
sInput = Replace(sInput, "<li>", "-") |
This file contains hidden or 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
BEGIN TRAN | |
if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tmp_table_value') and xtype='U') | |
drop table #tmp_table_value | |
CREATE TABLE #tmp_table_value | |
([table_id] [int] NOT NULL, | |
[value_date] [datetime] NOT NULL, | |
[raw_value] [decimal](12, 6) NULL | |
) |
This file contains hidden or 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
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") | |
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime") | |
Set-Location $PSScriptRoot | |
$pLoadCSOMProperties=(get-location).ToString()+"\Load-CSOMProperties.ps1" | |
. $pLoadCSOMProperties | |
Function DeleteVersionsFromLists($web, $versionCount) | |
{ |
This file contains hidden or 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
# Log in to Azure | |
Login-AzureRmAccount | |
# Set up key variables | |
$subscrName="<name of your Azure subscription>" -- "Visual Studio Premium with MSDN" | |
$rgName="<your resource group name>" -- "SharePoint-2013" | |
$locName="<the Azure location of your resource group>" -- "WestEurope" | |
$dnsName="<unique, public domain name label for the SQL server>" -- "sp2013-db-01" | |
# Set the Azure subscription |
This file contains hidden or 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 GetWebPartByTitle() | |
{ | |
param( | |
[Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] | |
[Microsoft.SharePoint.Client.WebParts.WebPartDefinitionCollection] $webParts, | |
[Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] | |
[string] $webPartTitle | |
) | |
if($webparts.Count -gt 0){ | |
Write-Host "Looping through all webparts" |