Ban4na Posted February 10, 2014 Posted February 10, 2014 Hi. I need ur help in this one... My folder structure looks like this: Mustermann.MaxDesktop Anwendungsdaten ... Example.DanielDesktop Anwendungsdaten ... Test.SusanDesktop Anwendungsdaten ... Thats some regular Home-Drives. As my schools storage space is nearly full we decided to reset all folders and files to 0 until we can afford more HDDs (Austrian school budgets are really bad). My goal is now to keep the folder in example "Mustermann.Max" since it has all the right privileges set and i only want to delete everthing in it. I have more than 1800 Accounts so i don't want to do it by hand. Deleting the Profiles is no problem since the folders create itself with the right attributes when logging on. Does anyone have a handy script or knows a tool that is able to do what i want. Thanks in Advance Ban4na
amckinley Posted February 24, 2014 Posted February 24, 2014 you could try something like del Mustermann.Max\* /s This will delete all files in the directory and sub directories, but leave the folder itself alone. the 'del' is delete, and then i look at modifies or variables found here Microsoft Corporation I would still make a few test folders to try it on first
mikeyd101 Posted February 24, 2014 Posted February 24, 2014 (edited) look at delprof2 it might do what your looking for but might still require run on each machine, we have large churn of users so as they login to each machine profile directories are created cna get upto couple of hundred profile directories on some machines, I used that over the summer in a summer2013 login script just went round to each machine and logged in, done chkdsk, delprof and defrag, as part of our summer clean out. Delprof2 - User Profile Deletion Tool Be very careful with this, i have 20 odd years non-experience with computers and still managed to delete my profile directory and documents i needed using this. Edited February 24, 2014 by mikeyd101
old_n07 Posted February 26, 2014 Posted February 26, 2014 Here is a simple Poweshell script that I've used in the past, just edit the $rootPath variable to reflect your own path to the student user directories $RootPath = "\\servername\path to share" #location of user directories (Get-ChildItem $RootPath -Directory).Name | ForEach-Object {Get-ChildItem "$RootPath\$_" -Recurse | Remove-Item -Recurse -Force}
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now