Manage vCenter permissions with VMware PowerCli

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.

ListOfPermissionCommand

VMware vCenter per

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.

ListOfFolders

List of VM folders

To assign permission to only one folder I will create new varible which will store one folder. $Osk = Get-Folder -Name Osaka

FolderVar.jpg

Assign variable

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.

addingpermission.jpg

Assigning new permission

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.

listingpermission

Listing folder permission

removingpermission

Removing permission form the folder

Thank you for reading.

 

 

One response to “Manage vCenter permissions with VMware PowerCli

  1. Pingback: Working with VMware vCenter using Powershell and TabExpansionPlusPlus module | Virtual Elementary·

Comments are closed.