Hi,
I have a number of Teams which are front ends for assessments.
In the 'Student Work' folder on the site, I want to remove that sharing access for all of the students in one big hit.
Is there a Power Automate or Powershell script that I can use to make this happen.
I do not have admin access, I am just the owner of the Teams,
I can sync them to my HDD using OneDrive and use powershell or I can logon to the site in a browser and use Power automate or an Automate Quickstep.
I have tried via ChatGPT and gemini to generate a powershell and failed miserably.
Any suggestions would be welcome.
here is a starter:
$sourcePath = "..."
# Get all subfolders one level below the source directory
$subfolders = Get-ChildItem -Path $sourcePath -Directory
foreach ($subfolder in $subfolders) {
# Put code here to change sharepoint sharing
Write-Host "Directory '$subfolder' Completed"
}
Write-Host "Sharing changes completed!"