powershell – delete user profile

Get-CimInstance -Class Win32_UserProfile | Where-Object {​​​​​​​​ $_.LocalPath.split('\')[-1] -eq 'UserXYZ' }​​​​​​​​ | Remove-CimInstance

Leave a Reply

Your email address will not be published. Required fields are marked *