View | Unassign User PowerCLI

· 1 min read Human-written

If you dont want to unassign all users by hand simply provide this script a .csv file with desktop names and it will do it for you.


$filepath = "desktops.csv"
import-csv $filepath -Header Desktop | Foreach-object {
remove-userownership -machine_id (Get-DesktopVM -name $_.Desktop).machine_id
}