posts
A script to check whether the files within your SharePoint site(s) are indexable and searchable.
#Requires -Modules PnP.PowerShell Clear-Host # ===== Settings ===== $clientId = "xxxxxx" $dateTime = Get-Date -Format "yyyy-MM-dd-HH-mm-ss" $tenantUrl = "https://contoso.sharepoint.com" # NEW: File extensions to exclude (case-insensitive) as they can't be searched using their Path metadata, e.g. Path:FileUrl $ExcludedExtensions = @('.png', '.jpg', '.jpeg', '.xltx', '.one', '.onetoc2', '.gif','.mp4','.agent') $invocation = Get-Variable -Name MyInvocation -ValueOnly $directoryPath = Split-Path $invocation.
posts
cls # Connection String Variables, including client specific ID and Tenant $clientId = "xxxxxxx" #$dateTime = (Get-Date).toString("dd-MM-yyyy-hh-ss") $invocation = (Get-Variable MyInvocation).Value $directorypath = Split-Path $invocation.MyCommand.Path # Set parameters $csvPath = $directorypath + "\Sites.csv" # CSV should have a column 'SiteUrl' $destiUrl = "https://contoso.sharepoint.com/sites/test"; $destList = "OwnersMapping"; # Define users to exclude $excludedUsers = @("tom, roy", "mary, jane") $excludedusersemails = @("tom.roy@contoso.co.uk", "mary.jane@contoso.co.uk") # Output CSV for results #$outputCsv = $directorypath + ".
posts
$envTermGroup = "Document Management Tags" $termSId = "b6ddada5-25b5-xxx-xxxx-b473235d6278" #c65620d8-ee35-4a47-83ed-3da15bf74a0a" #Tags old term set $csvPath = "C:\Users\343614\OneDrive - ssss\Documents\scripts\termsets_import\Import csv - all tags - with synonyms - Delta - test.csv" $logFile = ".\term_synonyms_Log-$(Get-Date -Format "yyyyMMdd-HHmm").csv" function Log-Message { param ( [string]$Message, [string]$Status ) 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).