0X00000787

RPC_S_PRF_ELT_NOT_REMOVED (0x00000787): Quick Fix

Server & Cloud Intermediate 👁 12 views 📅 May 27, 2026

This error means a profile element in Windows RPC is stuck and can't be removed. The registry fix below clears the broken entry fast. Don't waste time reinstalling drivers.

I know this error is annoying. It shows up when you're trying to remove a network profile or user profile in Windows, and Windows just refuses. Don't bother reinstalling drivers or running SFC — that's not the problem.

The fix: Delete the broken profile element from the registry

The culprit here is almost always a corrupted profile entry in the RPC registry key. Windows RPC keeps a list of active profile elements, and when one gets stuck, it throws error 0x00000787. Here's how to nuke it.

  1. Open Regedit as administrator. Right-click Start, select Run, type regedit, hit Enter.
  2. Back up the registry first. File > Export, save a copy somewhere safe.
  3. Navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\Security\ProfileElements
  4. You'll see subkeys named with GUIDs — those are your profile elements. Each has a value called ProfileElementName. Find the one that matches the profile you're trying to remove. If you're unsure, look at the timestamp or the name.
  5. Delete that entire subkey. Right-click it, choose Delete.
  6. Close Regedit and reboot your machine.

After the reboot, try your profile removal operation again. It'll work this time.

Why this works

The RPC subsystem in Windows maintains a list of profile elements for active remote procedure calls. When a profile element is removed normally, Windows deletes it from this registry key. But if something crashes mid-operation (like a network drop or a hung RPC call), the entry stays behind. The profile element is orphaned — Windows thinks it's still in use, so it refuses to let you remove it. Deleting the orphaned key manually tells Windows "this thing doesn't exist anymore," and the error goes away.

This is a classic RPC sync problem. It's not a driver bug or a Windows corruption issue. It's just a stale entry that the cleanup code missed.

Less common variations

Sometimes the registry key isn't exactly where I said. If you don't see ProfileElements under that path, check these locations:

  • HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Rpc\Security\ProfileElements — for 32-bit RPC calls on a 64-bit system.
  • HKEY_CURRENT_USER\Software\Microsoft\Rpc\Security\ProfileElements — rare, but sometimes user-specific profiles land here.

If you still can't find the entry, use Process Monitor (procmon) to catch the exact registry key being accessed when the error hits. Filter by Rpc and 0x00000787. That'll show you the path.

Another variant: the error can appear during Active Directory profile synchronization. In that case, the profile element is on a domain controller. You'd need to delete it from the DC's registry, same key path. But be careful — messing with a DC's registry can break things if you're not sure what you're doing. When in doubt, promote a different DC and demote the faulty one.

Prevention

This error usually comes from abrupt termination of RPC calls. To avoid it:

  • Don't force-close applications that are managing network profiles (like VPN clients or user profile management tools).
  • When you need to remove a profile, use the proper tool: net user, Remove-RoamingUserProfile in PowerShell, or the GUI in System Properties. Don't just delete profile folders manually.
  • If you're running a custom script to remove profiles, add a delay after the removal command to let RPC finish its cleanup.

I've seen this exact error on Windows 10 22H2 and Windows 11 23H2. The fix is the same on both. It's rare, but when it hits, you now know how to kill it in under 5 minutes.

Was this solution helpful?