Sharing Permissions in Teams for Student Work

21 views
Skip to first unread message

James Bowater

unread,
Sep 4, 2025, 11:14:44 PMSep 4
to Techies for schools
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!"
Reply all
Reply to author
Forward
0 new messages