Set-VIRole Command | Vmware PowerCLI Reference

Set-VIRole

This cmdlet modifies the privileges of the provided roles.

Syntax

Set-VIRole
-Role < Role[] >
[-AddPrivilege < Privilege[] > ]
[-Name < String > ]
[-ProgressAction < ActionPreference > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Role Role[] named
  • pipeline
  • wildcards
Specifies the roles you want to modify.
optional AddPrivilege Privilege[] named
  • wildcards
Specifies privileges and privilege groups you want to add to the provided roles.
optional Name String named
Provides a new name for the provided role.
optional ProgressAction ActionPreference named
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Set-VIRole
-Role < Role[] >
[-Name < String > ]
[-ProgressAction < ActionPreference > ]
[-RemovePrivilege < Privilege[] > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Role Role[] named
  • pipeline
  • wildcards
Specifies the roles you want to modify.
optional Name String named
Provides a new name for the provided role.
optional ProgressAction ActionPreference named
optional RemovePrivilege Privilege[] named
  • wildcards
Specifies privileges or privilege groups you want to remove from the provided roles.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.

Output

VMware.VimAutomation.ViCore.Types.V1.PermissionManagement.Role

Examples

Example 1

Set-VIRole -Role Role -AddPrivilege (Get-VIPrivilege -Name 'Create Datacenter')

Adds the "Create Datacenter" privilege to the Role role.

Related Commands

VIRole

This cmdlet retrieves all roles defined on the provided servers.

This cmdlet creates a new role on the specified servers and applies the provided privileges.

This cmdlet removes the specified roles.

This cmdlet modifies the privileges of the provided roles.