In SharePoint 2010, I have a need to create a document store with multiple folders within, then set permissions on each folder for individual users.
Teacher will have Full control on the Document Library & all contents
Student A will have Contribute to the Folder Student A
Student B will have Contribute to the Folder Student B
...... and so on.
The Folder Names & Usernames will come from an AD export into a csv file.

I can seem to manage to create the folders from the csv file using Powershell when the Document Library is mapped to a drive. I would prefer to connect Powershell directly to the Document Library to create then set the permissions.

Does anyone have a script that can do this that I could edit for my own needs as it's one of those things that if I can get right, will help lots of our teaching staff here.

Scripting is not one of my strong points.