How to Mass Delete User Profiles on Windows Server 2025?

0
27
Asked By TechGuru92 On

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?

2 Answers

Answered By AdminOps2022 On

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!

Answered By ScriptMaster98 On

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.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.