Remove-VIRole Command | Vmware PowerCLI Reference


This cmdlet removes the specified roles. To remove a role that is associated with a permission, you need to set the Force parameter to $true.


-Role < Role[] >
[-Force ]
[-Server < VIServer[] > ]


Required Parameter Name Type Position Features Description
Role Role[] named
  • pipeline
  • wildcards
Specifies the roles you want to remove.
optional Force SwitchParameter named
Indicates that you want to remove the role even if it is associated with a permission.
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.



Example 1

Get-VIRole -Server $server -Name "Customer*" | Remove-VIRole

Removes the roles with names that start with "Customer".

Related Commands


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.