- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
export roles from one vcenter and import to another
I got 6 vcrnters that I need to create the same role
how do I export the rtole from one vcenter and import into another?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check the following links:
vGeek: Export vcenter roles (privileges) - Powercli.
vGeek: import vCenter roles (privileges) - Powercli.
Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi tdubb123
Did you have a chance to read the blog post I referenced in my previous post? Do you have any additional doubt? If not, remember to mark answers as helpful or correct.
Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
was this ever solved?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Export
Get-VIRole |
Select @{N='vCenter';E={$_.Uid.Split('@:')[1]}},
Name,
@{N='PrivilegeList';E={[string]::Join([char]10,$_.PrivilegeList)}} |
Export-Csv -Path .\roles.csv -NoTypeInformation -UseCulture
Import
Import-Csv -Path .\roles.csv -PipelineVariable row |
ForEach-Object -Process {
$Role = @{
Name = $row.Name
Privilege = $row.PrivilegeList.Split("`n") | ForEach-Object { Get-VIPrivilege -Id $_ }
Server = $row.vCenter
Confirm = $false
WhatIf = $true
}
New-VIRole @role
}
Note that you will have to exclude the system-defined Roles.
They are created automatically, and a user can not create those
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know this is an ancient thread but I wanted to say thank you to Luc. This still works in 8.0U2. I have been meaning to find a way to export and import our custom roles for ages and finally got around to it.