Author Posts

September 6, 2018 at 8:21 pm

Hi,

I am trying to delete users' home folders who no longer have an AD account. I found that Remove-Item only works properly if you use Get-ChildItem first and pipe it to Remove-Item.

This is the command I am using:

Get-ChildItem c:\whatever -Recurse -force | Remove-Item -force -recurse -Confirm:$true

It properly deletes the folder contents (including Favorites), but it does not delete the folder itself. I then try to delete it using Remove-Item but it says the folder is being used by another process.

Does anyone know how to get around this issue?

Thanks!

 

September 7, 2018 at 1:34 pm

Was the profile recently created? Some windows service might be processing it.

September 7, 2018 at 4:50 pm

Thanks I found out that was an apache process 🙁

Thanks!