# Sample Code used to Create Licensing Groups for Teachers and Students
# These group are used by STEPER to help identify new users. You can optionally assign licenses via the Azure AD Console
# Andrew Sharrad 1/12/2020 v1.0

$UserName = "globaladmin@myschool.org.uk"
$Password = "Password99!"
# to create a team group for the students, change the line below to $CreateAllStudentsTeam = $true
$CreateAllStudentsTeam = $false

$A1Faculty = "Stone-Licensing-A1Faculty"
$A1Student = "Stone-Licensing-A1Student"

# Do not edit the lines below 

$GAPassSec = ConvertTo-SecureString -AsPlainText $Password -Force
$GACreds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $UserName,$GAPassSec

Install-Module MSOnline -Confirm:$False -Force -SkipPublisherCheck
Connect-MsolService -Credential $GACreds

New-MsolGroup -DisplayName $A1Faculty -Description "Group that assigns the A1 faculty licenses"

if ($CreateAllStudentsTeam -eq $true) {
    New-MsolGroup -DisplayName $A1Student -Description "Group that assigns the A1 student licenses"
} 
