When deleting large directories some subdirectories have files and folders that have failed to inherit domain administrator ownership. When attempting to delete the directories you simply get a message saying "you need permission to perform this action". Taking ownership with powershell
#takeown /F thefoldername /R /D Y
reports as successful but attempting to delete again just gives the same message. In the past I've just have to tunnel down into every folder to find that one file has not picked up ownership and do it manually. There must be an easier way? I come across this a lot.
Thanks