cheaptonersucks Posted July 9, 2021 Posted July 9, 2021 Hi All, Has anyone got a script to bulk create unified groups in O365 for all the classes for Teams? We are looking at creating groups for over 700 classes in Teams, so that the teaching staff can just use a group to add the students, to save them adding all of the students manually in September. Thanks
ChrisH Posted July 9, 2021 Posted July 9, 2021 There are tools that you can purchase to do this for you or use something like: https://sds.microsoft.com/ You will find threads on here somewhere with more details. 1
chazzy2501 Posted July 9, 2021 Posted July 9, 2021 yes sds using the slamandersoft tool to extract csv's from your MIS system. https://www.salamandersoft.co.uk/school-data-sync-support/ 1
slugshead Posted July 14, 2021 Posted July 14, 2021 (edited) This is what I use. Export CSV for iSAMS, tweak it as required and let it run 1 #Enter a path to your import CSV file 2 $ADUsers = Import-csv C:\SPREADSHEET.csv 3 4 foreach ($User in $ADUsers) 5 { 6 7 $Username = $User.username 8 $Password = $User.password 9 $Firstname = $User.firstname 10 $Lastname = $User.lastname 11 $OU = $User.ou 12 $initials=$User.initials 13 14 #Check if the user account already exists in AD 15 if (Get-ADUser -F {SamAccountName -eq $Username}) 16 { 17 #If user does exist, output a warning message 18 Write-Warning "A user account $Username has already exist in Active Directory." 19 } 20 else 21 { 22 #If a user does not exist then create a new user account 23 24 #Account will be created in the OU listed in the $OU variable in the CSV file; 25 New-ADUser ` 26 -SamAccountName $Username ` 27 -UserPrincipalName "[email protected]" ` 28 -Name "$Firstname $Lastname" ` 29 -GivenName $Firstname ` 30 -Surname $Lastname ` 31 -Enabled $True ` 32 -ChangePasswordAtLogon $True ` 33 -DisplayName "$Lastname, $Firstname" ` 34 -Department "Students" ` 35 -Initials $initials ` 36 -Description "Student User" ` 37 -Path $OU ` 38 -HomeDrive "N:" ` 39 -HomeDirectory "\\Server\Share\$Username" ` 40 -AccountPassword (convertto-securestring $Password -AsPlainText -Force) 41 42 } 43 } CSV Like this username,Password,OU,firstname,Initials,lastname,Email Address username,randompassword,"OU= , OU= , DC= ", firstname, initials, surname, emailaddress Edited July 14, 2021 by slugshead 1
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