Get-VIRole Command | Vmware PowerCLI Reference

Get-VIRole

This cmdlet retrieves all roles defined on the provided servers.

Syntax

Get-VIRole
[-Id < String[] > ]
[-Name < String[] > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
optional Id String[] named
  • wildcards
Specifies the IDs of the roles you want to retrieve. Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that matches exactly one of the string values in that list.
optional Name String[] named
  • wildcards
Specifies the names of the roles you want to retrieve.
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

Get-VIRole -Server $server -Name "Admin*"

Retrieves all roles on the specified server with names that start with "Admin".

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.