Tuesday, January 10, 2017

How to delete a user profile in Windows with PowerShell

In a previous article, we showed you how to delete a user profile in Windows using the graphical user interface. In this article, we are going to do it with PowerShell.

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