View | Unassign User PowerCLI

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
} 

 

Leave a Reply

Your email address will not be published.

*