Remove-Entra-Group-Assignments
1.0
This script connects to Microsoft Graph and removes a specified device object
(from Entra ID / Azure AD) from all directly assigned group memberships.
The script performs the following operations:
- Retrieves all directory objects the device is a member of
- Filters results to only include Entra ID groups
- Identifies and skips dynamic membership groups (cannot be m
(from Entra ID / Azure AD) from all directly assigned group memberships.
The script performs the following operations:
- Retrieves all directory objects the device is a member of
- Filters results to only include Entra ID groups
- Identifies and skips dynamic membership groups (cannot be m
This script connects to Microsoft Graph and removes a specified device object
(from Entra ID / Azure AD) from all directly assigned group memberships.
The script performs the following operations:
- Retrieves all directory objects the device is a member of
- Filters results to only include Entra ID groups
- Identifies and skips dynamic membership groups (cannot be modified)
- Removes the device from all eligible (static) group memberships
- Skips non-group objects such as directory roles or administrative units
This is useful for:
- Device offboarding
- Cleanup of legacy or incorrect group assignments
- Preparing devices for reassignment or re-enrollment workflows
- Maintenance window orchestration scenarios (e.g., kiosk devices)
Show more
(from Entra ID / Azure AD) from all directly assigned group memberships.
The script performs the following operations:
- Retrieves all directory objects the device is a member of
- Filters results to only include Entra ID groups
- Identifies and skips dynamic membership groups (cannot be modified)
- Removes the device from all eligible (static) group memberships
- Skips non-group objects such as directory roles or administrative units
This is useful for:
- Device offboarding
- Cleanup of legacy or incorrect group assignments
- Preparing devices for reassignment or re-enrollment workflows
- Maintenance window orchestration scenarios (e.g., kiosk devices)
Installation Options
Owners
Package Details
Author(s)
- Alexander Marrero
Tags
Intune EntraID MicrosoftGraph DeviceManagement Automation
Dependencies
This script has no dependencies.
Release Notes
Version 1.0:
- Initial release
- Removes direct group memberships from Entra ID device objects
- Skips dynamic groups and non-group directory objects
FileList
- Remove-Entra-Group-Assignments.nuspec
- Remove-Entra-Group-Assignments.ps1
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 1.0 (current version) | 0 | 5/18/2026 |