# # PowerCLI Script to Clone vCenter Roles # 09/11/13 - CloudPro # # Some code from http://psvmware.wordpress.com/2012/07/19/clone-roles-between-two-virtual-center-servers/ Thanks! # # Added variables and renaming option # # INSTRUCTIONS: # Modify variables and then copy/paste into PowerCLI # Set vCenter Variables and Connect to vCenters $VC1 = "vcenter1.domain.tld" $VC2 = "vcenter2.domain.tld" Set-PowerCLIConfiguration -DefaultVIServerMode multiple -Confirm:$false Connect-viserver -server $VC1,$VC2 -credential (get-credential) # Set Roles - Use the Same Name to Copy, or different names to rename during the copy # Re-use this block of code for each role $ROLE = "Browse Datastore" $NEWROLE = "Browse Datastore" [string[]]$privsforRoleAfromVC1=Get-VIPrivilege -Role (Get-VIRole -Name $ROLE -server $VC1) |%{$_.id} New-VIRole -name $NEWROLE -Server $VC2 Set-VIRole -role (get-virole -Name $NEWROLE -Server $VC2) -AddPrivilege (get-viprivilege -id $privsforRoleAfromVC1 -server $VC2)
Wednesday, September 11, 2013
PowerCLI Script to Clone vCenter Roles
Subscribe to:
Post Comments (Atom)
Featured Post
Remove 3D Objects and other annoying folders on Windows 10
Microsoft just keeps adding more crap to clutter up the navigation in Windows 10. Seriously, who needs a 3D Objects folder? The tiny perc...
-
Sometimes a VM snapshot can get corrupted. You can check for consistency by running vmkfstools against the last snapshot in the chain for a...
-
I recently deployed a new UCS blade, and I was greeted with the error: " configuration failed due to compute-unavailable,insufficient...
-
So I updated to Windows 8.1 because I figured it's been out long enough and the vendors got the driver issues fixed...apparently not! ...
No comments:
Post a Comment