Created
May 10, 2016 18:03
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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