Manage vCenter permissions with VMware PowerCli
Sometimes we need to manage vCenter permision for diffrent users to have access to diffrent VMs. PowerShell VMware module come handy here, it contain command VIPermission we can use it with Get-, Set-, New- and Remove- verbs.
In my lab I have created diffrent folders to separate offices VM’s now I need to add permission to personal from one office to be able only see VM’s belongs to them. First I will list out all VM folders. We will use another command which part of VMware PowerCli Module Get-Folder -Type VM we will list all folders which keep VM’s in.
To assign permission to only one folder I will create new varible which will store one folder. $Osk = Get-Folder -Name Osaka
When we have ready varible we can add new permission to folder. We will use command New-VIPermission -Entity $Osk -Principle ‘username’ -Role ‘role to assign’ -Propagate:$false.
This command assigned ReadOnly permission for user to folder Osaka. To list we can use Get-VIPermission -Entity $osk. We can as well remove permission by first listing permision for specific user and pipe it to Remove-VIPermission.
Thank you for reading.