Files
management-scripts/rmm/Remove-UserAccount.ps1
2026-10-01 09:39:44 -04:00

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