I keep banging my head against the wall figuring out why this wont work. from https://deployhappiness.com/delete-unused-home-folders-with-powershell/ there is a handy script which does exactly what i want. Of course there are some folders in there that i want to be excluded because someone decided to use them for a team.
The script has a handy place to exclude drives $NamesToIgnore = “Jmoody” , but when i use more than one name in there it freaks out. i have tried a comma, semicolon, space, quotes and probably lots of things that i have forgotten and it never gives me the results that i expect.
I just want to delete all of the old home drives from a share for users that no longer exist in AD with a list of exclusions that i can provide.
of course there are users who have had name changes, but i think i have all of those included in my list of exclusions, and besides we back up that share so when the complain i can restore it.
Thank you for the help, i am at the end of my rope!