jct_777
asked on
delete user account and associated redirect folders
We have an environment with around 2000 users (GPO with desktop and my docs redirected to the server) and every year we have a few hundred users leaving. Is there a way we can delete the user accounts and associated redirected folders at once?
Thanks in advance
Thanks in advance
ASKER
Thanks Benjamin. Not what I was looking for.
So do you want to be able to have script, enter a username, take ownership of those files, and then delete them? And then also have them deleted from AD? What about shares associated with users?
ASKER
Yes Lionelmm. No shares associated with users
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Lionelmm,
Looks good. I'd rather put it into a text file for the script to read when it run.
Thanks
Looks good. I'd rather put it into a text file for the script to read when it run.
Thanks
OK so only missing piece is how, what variable do we need to know to be able to know which folders to delete, that is associated with each user's name. In other words what is the variable for Y:\Redirected\Folder2Delet e I assume it is related to their username somehow so is it Y:\Redirected\%username%?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad to have helped--did it work as you wanted it to?
https://community.spiceworks.com/how_to/58010-how-to-ps-script-take-ownership-set-permissions-and-delete-folders-for-stale-user-folders-created-by-folder-redirection-gpo