-
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
EXOAddressList will not be created when EXOManagementRoleAssignment its provided #2523
Comments
Do you get an error message, or can you describe the error in more detail please? |
@malauter Yes here it is the error that I get after Start-DscConfiguration:
|
It seems like the New-AddressList cmdlet is not available in the PowerShell session. Was the Address List role already assigned to your account you are using for DSC? |
@malauter Thats true I have also tested this testcase. First I have created AddressList Role through EXOManagementRoleAssignment and than on a separate PowerShell session I have created AddressList and its working. On the same PowerShell session simultaneously with EXOManagementRoleAssignment it's not working we need this testcase. |
Folks, I have tried multiple ways to replicate this issue but can't. Can you confirm what the repro steps are and that you are still getting this with v1.22.1116.1? Thanks |
I will try with new version and will let you know. |
Hi @NikCharlebois, Configuration MainConfig
{
param
(
)
Import-DscResource -ModuleName "Microsoft365DSC"
Node localhost
{
EXOManagementRoleAssignment Container-180-ef28d3f7-94db-4a5c-8cec-87626cc9e939
{
SecurityGroup = "Organization Management";
Name = "Organization Management Role Adjustment";
Ensure = "Present";
Role = "Address Lists";
ApplicationID = "[APP-ID]";
TenantID = "[TENANT-ID]";
CertificateThumbprint = "[CERT-THUMBPRINT]";
}
EXOAddressList Container-182-7f0f4d22-0f79-4964-a174-b82c30769cc9
{
RecipientFilter = "((RecipientType -eq 'UserMailbox') -and (RecipientTypeDetails -eq 'EquipmentMailbox'))";
Name = "All Equipments";
Ensure = "Present";
ApplicationID = "[APP-ID]";
TenantID = "[TENANT-ID]";
CertificateThumbprint = "[CERT-THUMBPRINT]";
}
}
} It fails in the scenario that @malauter has described, i.e. I've removed the AddressList permission from Organization Management and removed the address list. And then I'm trying to create both in one go. Since @malauter said
how much hope is there that this can be fixed? |
@remyloy let's connect offline if you don't mind. I need additional details on this one as I am not able to replicate in any of my environments. |
We have introduced a new Disconnect function in the EXO workload inside of MSCloudLoginAssistant. The EXOManagementRoleAssignment resource will now wait for the changes to be effective inside of the Set-targetResource function and once the new permissions are effective, it will disconnect from Exchange Online, forcing the next resources to be loaded to refresh the connection and load the appropriate cmdlets based on the newly applied permissions. |
Hi @NikCharlebois, I've also tried it on a different tenant (a fresh M365 E5 developer tenant), but got the same result. What I observed in my tests is that during all my tests the 10s sleep never happened and therefore the EXO re-connect from EXOAddressList happens too early. I've modified the loop locally to at least sleep once and that fixed the issue, but I know that this is less than ideal. I've also looked for alternatives to replace Test-TargetResource with, but the only working method I found was to actually check for the missing cmdlet, i.e. By the way this is the snippet I used to play around and debug into it. $Creds = @{
TenantID = ''
ApplicationId = ''
CertificateThumbprint = ''
}
MSFT_EXOAddressList\Set-TargetResource -Name 'All Equipments' -RecipientFilter "((RecipientType -eq 'UserMailbox') -and (RecipientTypeDetails -eq 'EquipmentMailbox'))" @Creds -Ensure Absent
MSFT_EXOManagementRoleAssignment\Set-TargetResource -Name 'Organization Management Role Adjustment' -Role 'Address Lists' -SecurityGroup 'Organization Management' @Creds -Ensure Absent
Start-Sleep -Seconds 5
MSFT_EXOManagementRoleAssignment\Set-TargetResource -Name 'Organization Management Role Adjustment' -Role 'Address Lists' -SecurityGroup 'Organization Management' @Creds
MSFT_EXOAddressList\Set-TargetResource -Name 'All Equipments' -RecipientFilter "((RecipientType -eq 'UserMailbox') -and (RecipientTypeDetails -eq 'EquipmentMailbox'))" @Creds If it helps, I'm open to another offline session |
Details of the scenario you tried and the problem that is occurring
EXOAddressList / EXOManagementRoleAssignment are not working as supposed in our case the EXOAdressList throw an error please have a look below.
When I run the following commands in the Power-Shell everything seems to be working fine for EXOManagementRoleAssignment but for EXOAddressList it throw an error.:
The DSC configuration that is used to reproduce the issue (as detailed as possible)
MOF file extract:
The text was updated successfully, but these errors were encountered: