Removing dirs on NTFS (administrator)?

  • Thread starter Thread starter Al Blake
  • Start date Start date
A

Al Blake

For over a year(!) we have been trying to come up woth a method that is 100%
successful at removing user home and profile directories from the network
when they leave. The problem is many of the profile subdirs have exclusive
permissions for the owner - effectively shutting out the administrator from
removing the dir until they take ownership. I have seen 100s of posts
regarding this issue but no-one has come up with a definative answer. Here
is the batch file we are trying to use

subinacl /subdirectories \\minerva\studentprofile$\582963\*
/setowner="DOMAIN\administrator"
xcacls "\\minerva\studentprofile$\582963" /Y /T /G "DOMAIN\administrator":F
RD "\\minerva\studentprofile$\582963" /s /q
When we run this batch file we get:

C:\BATCH>subinacl /subdirectories \\minerva\studentprofile$\582963\*
/setowner="DOMAIN\administrator"
Default Sam Server will be minerva
Default Sam Server will be minerva
\\minerva\studentprofile$\582963\Cookies :
\\minerva\studentprofile$\582963\Cookies is the new owner
\\minerva\studentprofile$\582963\Cookies : 1 change(s)

C:\BATCH>xcacls "\\minerva\studentprofile$\582963" /Y /T /G
"CGGS\administrator":F

processed dir: \\minerva\studentprofile$\582963
processed dir: \\minerva\studentprofile$\582963\Cookies

C:\BATCH>RD "\\minerva\studentprofile$\582963" /s /q
\\minerva\studentprofile$\582963\Cookies - The process cannot access the
file be
cause it is being used by another process.
The process cannot access the file because it is being used by another
process.

See how the subinacl and the xcacls have worked (although why does xcacls
report the new owner as 'cookies' ?????) BUT we still can't remove the
directory, even though we are the domain adminsitrator.

What is the problem? This is driving me nuts as we have 1600+ accounts to
manage.

Al Blake, Australia
 
I should add that MINERVA is NOT a DC on our network.

Default Sam Server will be minerva
Default Sam Server will be minerva

so this doesnt make any sense to me?
 
Back
Top