VMware Cloud Community
jFishner
Contributor
Contributor
Jump to solution

Dump roles and permissions

I want to dump roles and privileges for audit purposes for my virtual center. How can I do this ? Sorry for not googling and asking questions here directly.

Reply
0 Kudos
1 Solution

Accepted Solutions
harkamal
Expert
Expert
Jump to solution

Get-PSSnapin -Registered | Add-PSSnapin -ErrorAction SilentlyContinue
Connect-VIServer -Server myVC.fqdn -User myUser -Password myPass


$si = Get-View ServiceInstance
$am = Get-View $si.Content.AuthorizationManager


$am.RoleList | % {
 $_.Name
 $_.Privilege | Sort | % { "`t" + $_ }
} | Out-File c:\dumpRole.txt | Notepad c:\dumpRole.txt

View solution in original post

Reply
0 Kudos
4 Replies
lamw
Community Manager
Community Manager
Jump to solution

Take a look here: http://www.virtu-al.net/2009/06/15/vsphere-permissions-export-import-part-1/

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

Twitter: @lamw

If you find this information useful, please award points for "correct" or "helpful".

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

If you have a large VI environment, the execution speed could become an issue.

Have a look at for different versions of the original script.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
harkamal
Expert
Expert
Jump to solution

Get-PSSnapin -Registered | Add-PSSnapin -ErrorAction SilentlyContinue
Connect-VIServer -Server myVC.fqdn -User myUser -Password myPass


$si = Get-View ServiceInstance
$am = Get-View $si.Content.AuthorizationManager


$am.RoleList | % {
 $_.Name
 $_.Privilege | Sort | % { "`t" + $_ }
} | Out-File c:\dumpRole.txt | Notepad c:\dumpRole.txt
Reply
0 Kudos
jFishner
Contributor
Contributor
Jump to solution

thank you everyone, appreciated

Reply
0 Kudos