Hi @MarcW64 

 

I have nothing to hand, but I've butchered a script I used last year to remove and readd licences for a bunch of students.

 

It should work, but try it on a single user to start off with.

 

 

$students = import-csv "C:\support\student_disable.csv" -delimiter ","
foreach ($student in $students)
{

    $ObjectID=$student.ObjectID
    $sku=$student.sku
    
    Set-MsolUserLicense -ObjectID $ObjectID -RemoveLicenses $sku -Verbose
    Set-MsolUser -ObjectID $ObjectID  -BlockCredential $true    

} 

 

 

The csv looks like this:

 

csvexample.png

 

If your csv has upn rather than ObjectID, then you can use the -UserPrincipalName switch instead of -objectid

 

Use Get-MsolAccountSku to get the correct licence name for your tenant. 

 

Hope this helps,

www.000webhost.com