New-VIPermission Command | Vmware PowerCLI Reference

New-VIPermission

This cmdlet creates new permissions on the specified inventory objects for the provided users and groups in the role. By default, new permissions are propagated down the hierarchy to sub-entities. You cannot create new permissions for the following objects: - direct child folders of a datacenter- root resource pools of clusters and standalone hosts.These objects always inherit the permissions of their parent.

Syntax

New-VIPermission
[ -Role ] < Role >
[ -Entity ] < VIObject >
-Principal < VIAccount >
[-ProgressAction < ActionPreference > ]
[-Propagate < Boolean > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Role Role 1
  • wildcards
Specifies the roles for which you want to create new permissions.
required
Entity VIObject 2
  • pipeline
  • wildcards
Specifies the inventory objects for which you want to create new permissions. Passing multiple values to this parameter is obsolete.
required
Principal VIAccount named
  • wildcards
Specifies users and groups to which you want to apply the new permissions. If you specify principal names by using the "domain\name" syntax, wildcards are not supported. Passing multiple values to this parameter is obsolete.
optional ProgressAction ActionPreference named
optional Propagate Boolean named
Indicates that you want to propagate the new permissions to the child inventory objects.
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.Permission

Examples

Example 1

New-VIRole -Name Role -Server $server -Privilege (Get-VIPrivilege -PrivilegeGroup)

$permission = New-VIPermission -Role Role -Principal Administrator -Entity (Get-Datacenter)

Creates a permission on the provided server for a role with the specified privileges.

Related Commands

VIPermission

This cmdlet retrieves the permissions defined on the specified inventory objects.

This cmdlet creates new permissions on the specified inventory objects for the provided users and groups in the role.

This cmdlet removes the specified permissions.

This cmdlet modifies the properties of the specified permissions.