MGNestedGroups is a PowerShell module that provides functions for working with nested groups in Azure Active Directory (Azure AD) and EntraID. This module allows you to apply licenses to all subgroups with user members of a specified group, get all subgroups with user members of a specified group, add all subgroups with user members as users of an enterprise application, and more.
You can install this module directly from the PowerShell Gallery using the following command:
Install-Module -Name MGNestedGroups -Scope CurrentUser
Here are some examples of how to use the functions provided by this module:
# Apply a license to subgroups under a specified top-level group
Grant-LicenseToMGSubgroups -TopGroupName "TopGroup" -LicenseName "YourLicenseName"
# Revoke a license from subgroups under a specified top-level group
Revoke-LicenseFromMGSubgroups -TopGroupName "TopGroup" -LicenseName "YourLicenseName"
# Add subgroups as users to an enterprise application
Add-MGSubgroupsToEnterpriseApp -EnterpriseAppId "YourAppId" -TopGroupName "TopGroup"
# Remove subgroups from an enterprise application
Remove-MGSubgroupsFromEnterpriseApp -EnterpriseAppId "YourAppId" -TopGroupName "TopGroup"
- Version 1.0.3:
- Improved the efficiency of the Get-MGSubgroups function.
Contributions are welcome! If you would like to contribute to this project
This module is licensed under the GNU General Public License v3.0 (GPL-3.0). Feel free to use, modify, and distribute it in accordance with the license.
This module is maintained by Ole Rand-Hendriksen.
If you encounter any issues or have questions, please create an issue on the repository.