Skip to content

Get-SecurityGroups returns all groups, not just security groups #22

@rieck-srlabs

Description

@rieck-srlabs

According to the name, Get-SecurityGroups should only return security groups. However, it currently returns all Entra ID groups.

This is because the group filter is incorrectly applied in the code:

    $graphApiUrl = "https://graph.microsoft.com/v1.0"
    $groupsUrl = "$graphApiUrl/groups?$filter=securityEnabled eq true"

Because $filter is not escaped, it is treated as a variable expansion and replaced with the empty string at runtime. The resulting URL is https://graph.microsoft.com/v1.0/groups?=securityEnabled eq true, which does not filter the results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions