posts
SHARING BEST PRACTICES
Try to manage permissions at the highest level (Group > Site > Library/List > Folder > Item) Avoid breaking Inheritance whenever possible
Limit Sharing Links options and disable the Anyone Link Set “Only People with Existing Access” as the default link type when Copy Link is pressed (see blog) Set up automatic link expiration (only globally enforceable for Anyone) Set default Sharing Links to “View Only” Use Sensitivity Labels to protect containers and content
posts
# ===== Settings ===== $clientId = "c9b5eaab-40cf-4e97-98ba-822241c2088c" $dateTime = Get-Date -Format "yyyy-MM-dd-HH-mm-ss" $CertPath = Read-Host "Please enter Certificate (.PFX) Path" $CertPassword = Read-Host "Please enter Certificate Password" -AsSecureString $Org = "bankofenglandcouk.onmicrosoft.com" $invocation = Get-Variable -Name MyInvocation -ValueOnly $directoryPath = Split-Path $invocation.MyCommand.Path # Log file path $logFile = Join-Path $directoryPath "Log-$dateTime.csv" # Create log header "Timestamp,Message,Status" | Out-File -FilePath $logFile -Encoding utf8 # ===== Logging Function ===== function Log-Message { param ( [string]$Message, [string]$Status = "Info" ) switch ($Status) { "Success" { $color = "Green" } "Info" { $color = "Blue" } "Error" { $color = "Red" } default { $color = "White" } } Write-Host -ForegroundColor $color "$Status => $Message" $logEntry = [PSCustomObject]@{ Timestamp = (Get-Date).