need help writing script to delete users home folder when they logout

I have about 35 imacs setup in 2 labs. I have the AD+OD triangle setup. the issue is that 1,000+ users have access to these machines and i don’t want they’re home folders clogging up the HD. Previously we used MacShield to solve this, but we have upgraded to X.6 and MacShield doesn’t support it. I need some kind of script or logout hook that will delete all the home folders except the local admin, or it could just delete the folder of the person logging out. I am fairly well versed with macs but writing scripts and code is a bit past my comfort level. so please explain well. Thanks

Hello.

What is an AD+OD triangle setup and what is X.6 ?

You have to be more specific about everything, and write a proper description of the whole problem, the context, for instance, how are the users home folders created in the first place. -Will the folders be deleted after their first logout. -Is fast user switching enabled? -And so on.

Have you considered the security issues? You obviously need an extra Administrator account with privileges to delete home folders of users, and the process on your logout hook must run with root privileges. Maybe it is possible to do something with keychain access scripting. -Another factor is that the logout hook I believe have only 10 seconds -or was it 20 to do its work.

Those are things you might take into consideration.