VMware vSphere

 View Only
  • 1.  export all vm-folder with groups and there members

    Posted Jun 10, 2025 08:30 AM

    Does anyone know a script that can read all VM folders with their authorized groups and the users they contain?



  • 2.  RE: export all vm-folder with groups and there members

    Posted Jun 18, 2025 02:57 AM

    Yes, you can do this via PowerCLI by iterating over each VM folder and checking permissions using Get-VIPermission. Here's a basic example that exports VM folders, assigned groups/users, and their roles:

    Connect-VIServer your-vcenter

    $report = @()

    Get-Folder -Type VM | ForEach-Object {
        $folder = $_
        $permissions = Get-VIPermission -Entity $folder

        foreach ($perm in $permissions) {
            $report += [PSCustomObject]@{
                FolderName = $folder.Name
                Principal  = $perm.Principal
                Role       = $perm.Role
                IsGroup    = $perm.Group
            }
        }
    }

    $report | Export-Csv -Path "VMFolderPermissions.csv" -NoTypeInformation

    This will give you a CSV with all VM folders and their assigned users or groups, including their role and group status.




  • 3.  RE: export all vm-folder with groups and there members

    Posted Jun 18, 2025 03:23 AM
    Hallo

    Thanks for the feedback.

    But Get-VIPermission no longer works under vSphere 8.0. It's mainly about resolving the local groups with the users under vsphere.local.

    Beste Grüße
    Tobias Heise

    -------------------------------------------------------------------------
    Universität Konstanz
    Kommunikations-, Informations-, Medienzentrum (KIM)
    Abteilung IT-Dienste Forschung, Lehre, Infrastruktur
    Sachgebiet Datacenter
    Gebäude V-409
    78457 Konstanz, Germany
    Tel: +49 7531 88-2434