4 lines
257 B
PowerShell
4 lines
257 B
PowerShell
# Note: this script came from https://adamtheautomator.com/powershell-delete-user-profile/
|
|
|
|
$UserToDelete = '{[UserToDelete]}'
|
|
Get-CimInstance -Class Win32_UserProfile | Where-Object { $_.LocalPath.split('\')[-1] -eq "${UserToDelete}" } | Remove-CimInstance |