New-VIRole Command | Vmware PowerCLI Reference

New-VIRole

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

Syntax

New-VIRole
-Name < String >
[ [-Privilege ] < Privilege[] > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Name String named
Specifies a name for the new role.
optional Privilege Privilege[] 1
  • wildcards
Specifies the privileges you want to apply to the new role.
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

New-VIRole -Name Role -Privilege (Get-VIPrivilege -PrivilegeGroup)

Creates a new role with the provided group privileges.

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.