Log on to the computer with the user profile you want to delete and run PowerShell as an administrator. The user profile you want to delete cannot be logged on to at the same time.
Run the following command with the user profile you want to delete. For a list of user profiles, see C:\Users.
Get-CimInstance Win32_UserProfile | Where-Object {$PSItem.LocalPath -eq "C:\Users\<USERNAME>"} | Remove-CimInstance -Confirm
Please note that deleting a user profile on the system does not delete the user's account on the local computer or domain. If the user logs on again, a new blank user profile is created for that user.
No comments:
Post a Comment