Skip to content

Instantly share code, notes, and snippets.

@jeffgreenca
Created May 10, 2016 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffgreenca/5f07ff2d30406ca44c31dfebeaba7e5c to your computer and use it in GitHub Desktop.
Save jeffgreenca/5f07ff2d30406ca44c31dfebeaba7e5c to your computer and use it in GitHub Desktop.
Compare specific privileges assigned to roles with matching names in two different vCenters
#Compare specific privileges assigned to roles with matching names in two different vCenters
#Populate two arrays with roles from old vCenter 5.5 and new vCenter 6.0
Connect-VIServer oldvcenter
$p_old = Get-VIRole
Disconnect-VIServer
Connect-VIServer
$p_new = Get-VIRole
Disconnect-VIServer
#Compare the PrivilegeList from old and new vCenters
foreach ($oldrole in $p_old) {
echo "*** Comparing old role $($oldrole.name) ***"
$newrole = $p_new | ? name -eq $oldrole.name
Compare-Object $oldrole.privilegelist $newrole.privilegelist
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment