Education - One-Shot script to Set up Automatic Student Drive Mapping + More

This is my first post to this forum, and I have had to trawl through the internet and perform a lot of testing to make this just work.

The original aim was to simply mount any student's share when they log in; a diabolically difficult effort due to an appalling lack of documentation.
Now, you may think, "Oh, that will be simple." Perhaps it is, but I sure couldn't find an adequate answer anywhere for a couple of years.

So, after finally making that work, a student can log in via Active Directory [MS or AD 4], and have all their personal SMB shares for their ID number mounted in their home directory as folders.

Additional elements have been added over time, to make this a mostly one-shot script, with some manual entry.

Some aspects still being worked on are printers, but that is not as hard as it used to be. I expect this will be different enough in each environment; you would need to customise this anyway.

The idea is, when setting up a machine, you join it to the Active directory during installation [otherwise, this won't work.]
You then perform all updates and reboot.
You acquire the script collection, with your customisations and special required files for installation [such as Chrome, Google Earth, etc], and run

I tend to keep the entire deployment on a USB stick and extract a tar.gz to a setup account on the target PC, chmod +x the deployment script, and then run it.

It's not perfect, there are still things which need to be done by hand, and some installers will prompt you for input; like KRB5, and the proprietary tools with fonts etc.

Hopefully, people will find this useful. It's not meant to be complex. Also, make sure you check and edit every file for your environment.

Further details and scripts at GitHub:


Students have, indeed asked about this very subject on this forum.


Thank you for sharing this! I'm sure there's lots of good stuff we can all learn from this.

A few Screenshots of the result of running deploy:

Login Screen:

Desktop as First Seen:

Clicking OK for Chrome Defaults:

Showing Drives Mounted For Student:

Showing ACLS Working:

Showing Their PDrive Share:

The important factor here is, that this is all using Kerberos Tickets. Access Control Lists work fine on the target shares automatically and there is no need to mount manually or enter a username and password; it is all passthrough. They have access to the same shares as a Windows machine does.


As the script develops, I am also adding hint sections for scenarios I have come across. The first major one is a hint on handling the network manager when the user is a student on a laptop; where they want to connect to home wifi.

Most students will not go to settings->WiFi to connect, which is a working method for a non-admin user. Instead, they go to the network manager, which demands elevation. The hint provides a method for changing this in the configuration so that normal users can make these changes. It is further augmented so that it would be used in a crontab, so that future updates would be corrected in the event that the altered configuration files are replaced.

1 Like