maxrebo Posted March 17, 2022 Posted March 17, 2022 Staff member wants a team with just female pupils - Easy to get CSV from MIS but cant see to find an easy way to bulk add them to a MS Group\Team from CSV. Can this be done?
snagrat Posted March 17, 2022 Posted March 17, 2022 You would need to use Powershell but yes it is possible 1
Oaktech Posted March 17, 2022 Posted March 17, 2022 Something like this? https://www.easy365manager.com/office-365-dynamic-groups/#:~:text=Dynamic%20groups%20are%20groups%20that,Premium%20P1%20or%20P2%20subscription. 1
Boredguy Posted March 17, 2022 Posted March 17, 2022 Very easy to do if you have the GUID of the team and powershell, or if they are in a AD Synchronised group you should be able to add them to the Team that was as well. 1
HarryMonkey Posted March 17, 2022 Posted March 17, 2022 <# .SYNOPSIS Add Students to Team Classes .DESCRIPTION This script will add students to Teams Classes from CSV spreadsheet. .NOTES Author: xxxxxxxxxxxxxxxxxx Version: 1.0 Creation Date: 07/04/2020 Purpose/Change: Initial script development Edited for now #> # Connect to Teams Connect-MicrosoftTeams # Add students to Teams Classes $members = Import-Csv -Path "C:\temp\examplecsv.csv" foreach ($member in $members) { $membersInTeam = Get-TeamUser -GroupId $member.GroupId -Role Owner | Select-Object -ExpandProperty User if ($membersInTeam -contains $member.userPrincipalName) { Write-Host -Object "$($member.userPrincipalName) is already in Team Class $($member.GroupId)" -ForegroundColor Yellow } else { Add-TeamUser -GroupId $member.GroupId -Role Owner -User $member.userPrincipalName Write-Host -Object "$($member.userPrincipalName) have been added to Team Class $($member.GroupId)" -ForegroundColor Green } } # Disconnect from Teams Disconnect-MicrosoftTeams
Boredguy Posted March 18, 2022 Posted March 18, 2022 <# .SYNOPSIS Add Students to Team Classes .DESCRIPTION This script will add students to Teams Classes from CSV spreadsheet. .NOTES Author: xxxxxxxxxxxxxxxxxx Version: 1.0 Creation Date: 07/04/2020 Purpose/Change: Initial script development Edited for now #> # Connect to Teams Connect-MicrosoftTeams # Add students to Teams Classes $members = Import-Csv -Path "C:\temp\examplecsv.csv" foreach ($member in $members) { $membersInTeam = Get-TeamUser -GroupId $member.GroupId -Role Owner | Select-Object -ExpandProperty User if ($membersInTeam -contains $member.userPrincipalName) { Write-Host -Object "$($member.userPrincipalName) is already in Team Class $($member.GroupId)" -ForegroundColor Yellow } else { Add-TeamUser -GroupId $member.GroupId -Role Owner -User $member.userPrincipalName Write-Host -Object "$($member.userPrincipalName) have been added to Team Class $($member.GroupId)" -ForegroundColor Green } } # Disconnect from Teams Disconnect-MicrosoftTeams [ATTACH=CONFIG]65021[/ATTACH] Obviously you would not be adding students in with the -role Owner but -role Member Only the Teachers should be an Owner
HarryMonkey Posted March 18, 2022 Posted March 18, 2022 Absolutely. This was just hacked about to do a set of teachers.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now