We used to use folder redirection and have a lot of data on a server. I need to remove specific folders from each users profile folder. For example we have a folder called users in it is UserA, User B etc in each folder there is a Pictures, Music folder. Its these Music and Pictures folder I need to remove but for thousands of users.
I was looking at something like this But it doesn't jsut do the Users\userA\pictures folder it also removes any folder called pictures in any sub folder in the users folder.
Get-ChildItem -path E:\users -Include 'Pictures' -Recurse -force | Remove-Item -force -Recurse -whatif
I had found a command that would do this 6 months ago when we stopped redirecting another folder but I cannot find the command.
I need something that goes to userA folder deletes either the folder called Pictures or the content of it then moves on to the User B folder.
Can anyone help
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.