MrCryoDrone Posted February 6, 2024 Posted February 6, 2024 Hello, Does anybody know how to fix the delprof2 error: Deleting profile '\\*computer*\C$\Users\*StudentUserProfile*' ...Could not delete key . Error: Access is denied. The tool successfully deletes the profile folder but not the registry on the machines? Please note, we're using PDQ with DA Privilege's. Thanks in advance Kieran
Oaktech Posted February 6, 2024 Posted February 6, 2024 One of my colleagues has set up a thing to collect the error log of delprof, do a takeown on every error and use it as a input to delete the error keys. I just leave it, so far it has not caused me an issue.
CHiLL Posted February 6, 2024 Posted February 6, 2024 That error has been an issue in DelProf2 for a very long time, since Windows 8 and the introduction of the Microsoft Store and Apps I believe and DelProf2 hasn't been updating in quite a number of years. It is fine to ignore it as the rest of the profile is deleted as expected. Just be aware that DelProf2 doesn't work when using /d switch to only delete after x amount of days, as Microsoft changed the way that the modified dates are read.
mavhc Posted February 6, 2024 Posted February 6, 2024 Don't use delprof, use powershell Get-CimInstance win32_userprofile | Where {$_.LastUseTime -lt $(Get-Date).Date.AddDays(-120)} | Remove-CimInstance 2
MrCryoDrone Posted February 6, 2024 Author Posted February 6, 2024 Thanks for the reply's guys, we ended up coming to the same conclusion as soon as I opened this thread to read the responses. The error was just throwing me off, and just had to definitely find out that the tool deletes the SID's in the correct places also. Thanks for the help guys!
Olliedawg Posted February 13, 2024 Posted February 13, 2024 Yea error can be ignored. Been using Delprof2 here for a while now in 3 IT suites, no issues with profiles
MrCryoDrone Posted February 13, 2024 Author Posted February 13, 2024 Great to hear! 1 week in and its really helping get rid of those pesky cached account on the 64gb notebook laptops! We have this on a schedule using PDQ remove old accounts past a certain date when the device is online
robintech Posted February 13, 2024 Posted February 13, 2024 (edited) Don't use delprof, use powershell Get-CimInstance win32_userprofile | Where {$_.LastUseTime -lt $(Get-Date).Date.AddDays(-120)} | Remove-CimInstance Seems to think people logged in recently in testing when i know its been a year, tried lastwritetime but its all blank on them Edit: think our antivirus must be altering the dates when it scans them Edited February 13, 2024 by ittech2342323
Lxshm Posted February 13, 2024 Posted February 13, 2024 (edited) Don't use delprof, use powershell Get-CimInstance win32_userprofile | Where {$_.LastUseTime -lt $(Get-Date).Date.AddDays(-120)} | Remove-CimInstance doesnt work, lastUsetime is always current date Edited February 13, 2024 by Lxshm
Bird97 Posted February 13, 2024 Posted February 13, 2024 You'd have to use it with something like the below to change the modify date $Dat = Get-Item "$Path\$UserName\NTUSer.dat" -force $DatTime = $Dat.LastWriteTime Don't use delprof, use powershell Get-CimInstance win32_userprofile | Where {$_.LastUseTime -lt $(Get-Date).Date.AddDays(-120)} | Remove-CimInstance
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