garethEds Posted July 4, 2022 Posted July 4, 2022 Good afternoon, Does anyone have a powershell script that can be run on logoff to delete a user profile? It's for use on some small ssd machines. User have mandatory profiles that stay on the machine. DelProf is not removing them quickly enough for us so I want to remove them as they log off. I found reference to one but the new script centre doesn't have it when searched. Many thanks Gareth
tmoon-mint Posted July 4, 2022 Posted July 4, 2022 I use this Delprof2: User Profile Deletion Tool • Helge Klein Sorry I cant read. Seems like you've already tried this.
RLR Posted July 4, 2022 Posted July 4, 2022 Not sure how reliable deleting profiles is these days with Windows 10 as it creates a reg key per user. I know there is a gpo that can delete files based how old a profile is but again, since windows 10 I think the DAT file that's used to determine age is not always correct. I've not used it before but there is software called Deep Freeze that might do what you want.
CHiLL Posted July 5, 2022 Posted July 5, 2022 DelProf2 hasn't worked correctly on Windows 10. The recommended method is the GPO: Computer Configuration > Policies > Administrative Templates > System > User Profiles > Delete user profiles older than a specified number of days on computer restart. I have that set to 60 days across all machines, so not to wipe staff profiles over the holidays for example.
free780 Posted July 5, 2022 Posted July 5, 2022 DelProf2 hasn't worked correctly on Windows 10. The recommended method is the GPO: Computer Configuration > Policies > Administrative Templates > System > User Profiles > Delete user profiles older than a specified number of days on computer restart. I have that set to 60 days across all machines, so not to wipe staff profiles over the holidays for example. I found I needed a scheduled task running as SYSTEM to fully remove profiles. 1
QwertyMash Posted August 7, 2022 Posted August 7, 2022 (edited) Not sure how reliable deleting profiles is these days with Windows 10 as it creates a reg key per user. I know there is a gpo that can delete files based how old a profile is but again, since windows 10 I think the DAT file that's used to determine age is not always correct. I've not used it before but there is software called Deep Freeze that might do what you want. We have a logon script that repairs the dates of the profiles so that GPO will work correctly. If anyone would like this script so that they can use the delete aged profiles GPO just hit me up. Cheers. Edited August 7, 2022 by QwertyMash 1
beavers8 Posted May 22, 2023 Posted May 22, 2023 Hi, Sorry to reply on an old Thread. Any chance I could try that script? same problem here with Delprof Thanks
EssentialRug Posted May 22, 2023 Posted May 22, 2023 https://gitlab.com/Lieben/assortedFunctions/blob/master/set-CleanupUserProfilesAfterDays.ps1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now