Zourous Posted July 15, 2019 Posted July 15, 2019 This is a new problem we've experienced this year with ever growing local profiles and small sized SSD's in place. When reported at the time, we fire off a manual delprof2 command to delete profiles until some plonk turns off the PC and then we're back to square one again. From what I've read and tried a bit, group policy isn't great at achieving this. In fact when I tried it, it didn't do anything and I gave up. Yes we can schedule delprof2 to delete profiles but ideally we would like just delete some of the older profiles. When I tried this it turns out there is some bug in the current versions of W10 and it just deletes the wrong profiles and not necessarily the oldest one's. Anyone have any other great ways to achieve this?
timbo343 Posted July 15, 2019 Posted July 15, 2019 Can you not run DelProf when the machine is turned on in the morning? The other alternative would be to use mandatory profiles over local profiles and maybe store the mandatory profile on the local machine? How often would you change the mandatory profile? We run mandatory profiles here and the local profile that it creates during logon is removed when the user logs off. 2
Popular Post Warwick_Tech Posted July 15, 2019 Popular Post Posted July 15, 2019 This is a new problem we've experienced this year with ever growing local profiles and small sized SSD's in place. When reported at the time, we fire off a manual delprof2 command to delete profiles until some plonk turns off the PC and then we're back to square one again. From what I've read and tried a bit, group policy isn't great at achieving this. In fact when I tried it, it didn't do anything and I gave up. Yes we can schedule delprof2 to delete profiles but ideally we would like just delete some of the older profiles. When I tried this it turns out there is some bug in the current versions of W10 and it just deletes the wrong profiles and not necessarily the oldest one's. Anyone have any other great ways to achieve this? We have tried several ways to achieve this - DelProf2 seems hit and miss on W10, so we used to use this Ps1 script $profiles = $null $profiles = Get-WMIObject -class Win32_UserProfile | Where {((!$_.Special) -and ($_.LocalPath -ne "C:\Users\Administrator") -and ($_.LocalPath -ne "C:\Users\UpdatusUser"))} if ($profiles -ne $null) { $profiles | Remove-WmiObject } Exit BUT this was also clunky and I think caused some printer connection issues - So instead I use this script now which you can easily alter days Get-CimInstance win32_userprofile -verbose | Where {$_.LastUseTime -lt $(Get-Date).Date.AddDays(-14)} | Remove-CimInstance -Verbose Just change '14' to however may days you wish. 7
Burrout565 Posted July 15, 2019 Posted July 15, 2019 What about the use of the 'Delete user profiles older than a specified number of days on system restart' policy? Under 'Comp. Configuartion\Admin Templates\System\User Profiles'? 2
robyholmes Posted July 15, 2019 Posted July 15, 2019 What about the use of the 'Delete user profiles older than a specified number of days on system restart' policy? Under 'Comp. Configuartion\Admin Templates\System\User Profiles'? We use this setting with DelProf2 as well but set to a higher number of days. So if Windows doesn't manage to remove the profile DelProf2 gives it a go. 1
Zourous Posted July 15, 2019 Author Posted July 15, 2019 What about the use of the 'Delete user profiles older than a specified number of days on system restart' policy? Under 'Comp. Configuartion\Admin Templates\System\User Profiles'? Tried this, but for whatever reason it did nothing. can't see what I was doing wrong.
Zourous Posted July 15, 2019 Author Posted July 15, 2019 We have tried several ways to achieve this - DelProf2 seems hit and miss on W10, so we used to use this Ps1 script BUT this was also clunky and I think caused some printer connection issues - So instead I use this script now which you can easily alter days Just change '14' to however may days you wish. Thanks, I might give the last script a try on a few PC's
themightymrp Posted July 15, 2019 Posted July 15, 2019 I use Delprof2 as a shutdown script. I only ever want to delete student profiles though to be honest so my scripts is quite simple. Student accounts all start with a number for their enrolment year, so it just looks like this: \\DOMAIN\netlogon\SoftwareGPOs\DelProf2.exe /q /id:18* /id:17* /id:16* /id:15* /id:14* /id:13* /id:12* /id:11* Not had any issues with it on Windows 7 or 10 so far
rosslaing Posted July 19, 2019 Posted July 19, 2019 (edited) What about the use of the 'Delete user profiles older than a specified number of days on system restart' policy? Under 'Comp. Configuartion\Admin Templates\System\User Profiles'? This doesnt work properly with windows 10. This policy uses the timestamp of the ntuser.dat file to determine the age of the profile. With windows 10 Store updates and some windows updates modify the .dat file on a regular basis, regardless of whether or not the user has logged on. I have had a premier support call into MS for this and they acknowledged this as a bug, but it has never been fixed. Delprof also uses the .dat file for age by default unless you change it to use the .ini, but even this is not accurate anymore, so you have the same problem. We have resorted to just cleaning our IT suites down completely using delprof 2 or 3 times a year. Edited July 19, 2019 by rosslaing
mavhc Posted December 18, 2019 Posted December 18, 2019 Anyone noticed that delprof2 doesn't seem to work properly if you have more than a month as the delay? 30 days if fine, 35 just doesn't find anyone to delete
Griff Posted December 19, 2019 Posted December 19, 2019 (edited) I have an issue where delprof2 cannot delete a reg key when deleting a user profile (see below) I think this then causes issues when they try to log back in Edited December 19, 2019 by Griff 1
DrBeaker Posted December 19, 2019 Posted December 19, 2019 This doesnt work properly with windows 10. This policy uses the timestamp of the ntuser.dat file to determine the age of the profile. With windows 10 Store updates and some windows updates modify the .dat file on a regular basis, regardless of whether or not the user has logged on. I have had a premier support call into MS for this and they acknowledged this as a bug, but it has never been fixed. Delprof also uses the .dat file for age by default unless you change it to use the .ini, but even this is not accurate anymore, so you have the same problem. We have resorted to just cleaning our IT suites down completely using delprof 2 or 3 times a year. Yet another thing to mark Windows 10 down as not a solid product fit for purpose. Why can't they focus on fixing bugs and THEN feature/system updates?
mavhc Posted December 19, 2019 Posted December 19, 2019 Fixing bugs is boring, plus sharing computers is bad for MS, they can't sell as many licences, you really really want 1:1 laptops, don't you... Remove-CimInstance is the alternative to delprof2, but the date issue is still a problem
PotNoodleTech Posted December 19, 2019 Posted December 19, 2019 We just manually run delprof2 in the holidays if we are doing maintenance in a room.
themightymrp Posted December 19, 2019 Posted December 19, 2019 I'm not fussed about how frequently it clear down student profiles so I have a batch file that runs via GPO as a shutdown script. Works really well and leaves staff profiles alone. Logon times for students are pretty good anyway on the machines with SSD's My script pretty much looks like this, student accounts start with the year of entry i.e. 19 is Year 7 and so on: \\domainname\netlogon\SoftwareGPOs\DelProf2.exe /q /id:19* /id:18* /id:17* /id:16* /id:15* /id:14* /id:13* 2
BOOT Posted December 19, 2019 Posted December 19, 2019 I have an issue where delprof2 cannot delete a reg key when deleting a user profile (see below) I think this then causes issues when they try to log back in I run it twice, seems to sort that issue second time around.
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