How to Mass Delete User Profiles on Windows Server 2025?
Asked by
TechGuru92
I'm looking for a way to bulk delete user profiles on Windows Server 2025. We've previously used DelProf2, but it seems to struggle with the registry path HKLMSOFTWAREMicrosoftWindows SearchUninstalledStoreApps. It appears there are user profile registry entries for each profile here, and by default, the Administrator doesn't have permission to delete them. I'm curious if this is a limitation with DelProf2 or if even the built-in Microsoft method in Advanced System Settings can handle it. What methods are you all using for bulk deleting user profiles on Windows 11 and Server 2025?
Answers
Here's a method Iโve been using for cleanup:
```powershell
# Get All Profiles
$AllProfiles = Get-CimInstance -ClassName Win32_UserProfile
# Validate profile to remove
$AllProfiles | where localpath -match 'xxx' | select localpath, sid
# Remove validated profile
$AllProfiles | where localpath -match 'xxx' | Remove-CimInstance
```
Not sure how this connects to that registry key you mentioned, but scripting the cleanup should be straightforward! Let me know if you need help with it.
Reply to this answer
Just a quick tip: make sure users are signed out of their profiles instead of just shutting down the PC. That could help with the process dramatically!
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions