We recently had a customers server have several User Profile issues and we were not able to log onto the server. The solution was to delete the user profiles remotely using this simple PowerShell command which was:
$Computer = "EXCH01" # Replace with your server's name or IP address
$Username = "alan" # Replace with the username of the profile you want to delete
Invoke-Command -ComputerName $Computer -ScriptBlock {
param($Username)
$profile = Get-WmiObject -Class Win32_UserProfile | Where-Object { $_.LocalPath.split('\')[-1] -eq $Username }
$profile | Remove-WmiObject
} -ArgumentList $Username
This website uses cookies.