Forum Discussion
parveenprajapati
Feb 19, 2021Copper Contributor
Want to archive teams in bulk
I want to archive teams in bulk with the id. i am sharing my script. but it is not happening. I am sharing my script. $a = Import-Csv C:\Users\parveen.kumar\Desktop\a.csv foreach ($a in $data) ...
parveenprajapati
Feb 20, 2021Copper Contributor
CoasterKaty Thanks Katy, the script is working fine. I have an another query. I have more then 2400 teams and for my school and I want to archive teams time to time in the end of the session with keyword like '2020', 'Class-VI-A', 'ICT', 'PA'. Is there any possibility in PowerShell to archive with keywords.
CoasterKaty
Feb 20, 2021MVP
parveenprajapati You could do something like:
Get-Team | Where {$_.DisplayName -like "*2020*" | Set-TeamArchivedState -Archived:$true
although if you're using Teams for school classes I'd recommend looking at School Data Sync for next year as it handles the creation/update/archival of teams for you.
- parveenprajapatiFeb 22, 2021Copper Contributor
CoasterKaty Thank you for your help. Its working now.