karthick1239
Contributor
Contributor

powercli set permission at VC level

I need a powercli script to automate some task in VC , I have found below script but here I can assign AD group permission to folder level. but I want to assign permission at VC level. is there any way we can do this.

$TargetVC="XXXX
Set-PowerCLIConfiguration -DefaultVIServerMode multiple -Confirm:$false
Connect-VIServer -server $TargetVC
$rootFolder = (Get-Folder foldername)
$user = get-viaccount -domain 'Domain name' -group -id 'AD group'
$role = Get-VIRole -Name 'xxx'
New-VIPermission -Entity $TargetVC -Principal $user -Role $role -Propagate $true -Confirm:$false

 also i need to create few vsphere.local users and assign read only permissions. i am can't find any powercli script for this. kindly help to solve this 

Labels (2)
0 Kudos
1 Reply
LucD
Leadership
Leadership

The folder Datacenters will do that.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos