I want to export a list of all vApps and the users with their permissions.
This works:
$CIUser = Get-CIUser -Org "MyOVDC"
$CIPerm = Get-CIAccessControlRule -user $CIUser
$CIPerm
Output:
Entity | User | AccessLevel |
------ | ---- | ----------- |
Cust_Catalog_Gen | OVDC_admin | ReadWrite |
So now I want to script this to cycle through each vApp and list each user and their permission, so I created this script:
$Report = foreach ($CIUser in Get-CIUser -Org "MyOVDC")
{
$CIPerm = Get-CIAccessControlRule -user $CIUser
New-Object PSOBject @{
Name = $CIPerm.User
Entity = $CIPerm.Entity
AccessLevel = $CIPerm.AccessLevel
}
}
$Report | Export-Csv "Report.csv"
But the output is:
Can someone help me to fix my script so that I can get the required output?