Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 251495

Re: Script to unassign users from VMware View

$
0
0

You want the Remove-UserOwnership cmdlet.

Provided the CSV contains the following fields

"VM","User"

"VM1","user1"

"VM1","user1"

You can do something like this

 

Import-Csvinput.csv-UseCulture|%$vm=Get-DesktopVM-Name$_.VM
 
if($vm.user_displayname-eq$_.User){    Remove-UserOwnership-machine_id$vm.machine_id
  } }

Viewing all articles
Browse latest Browse all 251495

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>