Hello All,
Have an AD group called Test. With that group name in vCenter at Datacenter, folders, cluster and datastore permissions are provided.
Lets say now AD team is renaming the Test group name to Test1 group name.
Let me know any scripts to apply the new group name(Test1) inplace of old name(Test) where the permission applied.
Thanks in adavce,
You could try something like this
$oldName = 'domain\Test'
$newName = 'domain\Test1'
Get-VIPermission | where{$_.Principal -eq $oldName} | %{
New-VIPermission -Entity $_.Entity -Principal $newName -Role $_.Role -Propagate $_.Propagate -Confirm:$false
Remove-VIPermission -Permission $_ -Confirm:$false
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference