-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EXOManagementRoleAssignment: Does not work if a soft-deleted identically named Administrative Unit exists #3064
Comments
That's an interesting find. The Get-MgAdministrativeUnit Graph cmdlet does it differently and doesn't return the soft deleted AU at all. I will try and reach out to the EXO Management Shell team. |
Would it be a viable solution for you if we were to leverage the Graph cmdlet that doesn't return soft-deleted AU instead? |
@NikCharlebois Whatever is easier for you! |
@NikCharlebois My only thought was that there's normally a delay between an AU being created/deleted in Azure AD and it being available/removed in Exchange Online. However thinking about it, in this instance, that would only be an issue where an AU was deleted (and as we know the current situation is broken there anyway). It feels like such an edge case that it's not worth worrying about. So yes, give it a try :) |
…e-with-AU Fixes #3064 - Administrative Unit via Graph
Thanks, that's really helpful! |
Details of the scenario you tried and the problem that is occurring
The resource EXOManagementRoleAssignment supports specifying Administrative Units by DisplayName (#2708). However it does not cope with the situation where an Administrative Unit has been soft-deleted and a new Administrative Unit created with an identical display name.
After deleting an Administrative Unit the AU remains in a soft deleted state for 30 days. At this point it cannot be hard deleted - you have to wait 30 days. https://learn.microsoft.com/en-us/azure/active-directory/fundamentals/recover-from-deletions#administrative-units-1
However the Get-AdministrativeUnit cmdlet in the Exchange Online PowerShell module which EXOManagementRoleAssignment uses at present does not return information about an AU being soft-deleted - it simply returns all AUs, whether soft-deleted or not.
This causes various errors when running a configuration where there is an AU which has been soft-deleted with the same name as one that has not.
Verbose logs showing the problem
Suggested solution to the issue
EXOManagementRoleAssignment does not cope well with multiple Administrative Units with identical DisplayNames. Suggest:
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
OsName : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage : en-GB
OsMuiLanguages : {en-GB, en-US}
Version of the DSC module that was used ('dev' if using current dev branch)
1.23.308.1
The text was updated successfully, but these errors were encountered: