Yes, that's possible. Try the attached script.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Your attached script starts from the permissions.
If a folder is not listed that could mean that there are no explicit permissions on that folder.
Is that perhaps the case for the two missing folders ?
You could go for a script that lists all the folders and then shows the permissions (implicit and/or inherited) for that folder.
Something like the attached script.
With the $inherited variable you can define if inherited permissions should be reported or not.
Note that the script will not list permissions that are assigned on other entities (like for example guests).
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The permissions are inherited. They ae defined in the Vcenter server. Is there a way to modify this script to report on only one datacenter?
Thanks
Try replacing this line (at the end of my script)
Get-Folder -Name "Datacenters" | Get-View | %{Get-Children $_ "" $inherited}
by this line
Get-Datacenter -Name "MyDatacenter" | Get-View | %{Get-View $_.VmFolder} | %{Get-Children $_ "MyDatacenter" $inherited}
You have to replace "MyDatacenter" with your datacentername twice.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Luc
The permissions are propigated down from an ESX server. Could we add a Defined In column?
Thanks
Yes, that's possible. Try the attached script.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Works great!
I have 2 questions:
1. How come in the report it says Defined In "datacenter" instead of the actual server name?
2. How come when I use $Report instead of $global:report I get a bank csv file?
1) Because internally the permissions defined at the top are assigned to the "hidden" folder called Datacenters and not to an individual ESX server in that datacenter. If you define a permission on an ESX server it will show the server.
2) That is due to the scope of PS variables. In the script I needed a variable that was visible inside the function and also in the outer level.
By adding the $global: prefix you make a variable visible in all the scope levels.
See Tobias's explanation (which is much better than mine) in Scope of Variables
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Luc... You're the best!