Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On our network we have approximately 2000 users all with folder redirection enabled so all data is stored centrally.
These are broken down into 3 folders: Desktop, Documents, Profile.
Is there a way that when we delete a user the relevant users folders in these 3 folders are all deleted as well? This problem is caused by having swathes of users leave at once (I work in education) so every year my predecessor was manually deleting approx 300 users folders from each of these folders and then their user accounts out of active directory.
The DC is running Windows Server 2008 R2, the users data Folders are on the DC
Is there an easier way to do this? Possibly a powershell script, I was thinking something along the lines of reading in from a text file with the users in, getting a username deleting the folders and then the user from AD and then moving onto the next username but am unsure how to do this. If someone has something it would be great.

share|improve this question
Having worked in education, I would use caution in automating large deletions. We normally had people broken down by grade level, so you can just prune a directory that had all the student subfolders for that graduating class. The same can be done in AD by deleting a grade level OU. – Bart Silverstrim Sep 19 '12 at 11:52
Not as elegant as automated deletions, but we found it to be a nice balance in management for our situation. – Bart Silverstrim Sep 19 '12 at 11:53
We have them broken down by grade level in AD but unfortunately in the file storage there are just those 3 folders, going through each one deleting 200 or so users from each one by hand is painstaking. – Joe Taylor Sep 20 '12 at 11:21
Sorry, I'm not quite understanding. You have the directory structure such that grade9 contains grade9's three folders under them, or your redirection isn't stored under each grade's designation? – Bart Silverstrim Sep 20 '12 at 11:59
The redirected folders contain all users folders. e.g Year1-Year5, if it was split it would be so much easier – Joe Taylor Sep 20 '12 at 13:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.