vMarkusK / VMware-vCD-Module

initial creation of VMware vCloud Director Objects like Org, Org User and Org VDC
https://mycloudrevolution.com/
MIT License
9 stars 3 forks source link

New-MyOrgAdmin - Does not work with vCD Module Version 11.0 #5

Open vMarkusK opened 6 years ago

vMarkusK commented 6 years ago

$vcloud.RoleReferences.RoleReference only returns System Roles and no Org Roles.

vMarkusK commented 6 years ago

Possible Solution:

if ((Get-Module -Name VMware.VimAutomation.Cloud).Version.Major -eq "6") { $vcloud = $global:DefaultCIServers[0].ExtensionData $orgAdminRole = $vcloud.RoleReferences.RoleReference | Where-Object {$_.Name -eq "Organization Administrator"}

        }
        elseif ((Get-Module -Name VMware.VimAutomation.Cloud).Version.Major -ge "11") {
            $orgAdminRole = $OrgED.RoleReferences.RoleReference | Where-Object {$_.Name -eq "Organization Administrator"}    
        }