You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Details of the scenario you tried and the problem that is occurring
Trying to use the 'EXODistributionGroup' module to create a mail-enabled security group.
Test-TargetResource always returns False which results in DSC attempting to (incorrectly) reconfigure the group.
There are also some errors regarding the 'OrganizationUnit' values differing despite the DSC configuration failing to request an update to these in any way.
Verbose logs showing the problem
VERBOSE: [COMPUTERNAME]: LCM: [ Start Resource ] [[EXODistributionGroup]MailEnabledSecurityGroup]
VERBOSE: [COMPUTERNAME]: LCM: [ Start Test ] [[EXODistributionGroup]MailEnabledSecurityGroup]
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Testing Distribution Group configuration for {Test-Gr
oup}
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Getting configuration of Distribution Group for Test-
Group
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Found Distribution Group Test-Group
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Get-TargetResource Result:
Alias=Test-Group; ApplicationId=; BccBlocked=False; BypassNestedModerationEnabled=False; CertificatePassword=$null; CertificatePath=; Certificate
Thumbprint=; Credential=; Description=$null; DisplayName=Test-Group; Ensure=Present; HiddenGroupMembershipEnabled=False; ManagedBy=user.name; Mana
gedidentity=False; MemberDepartRestriction=Closed; MemberJoinRestriction=Closed; Members=$null; ModeratedBy=; ModerationEnabled=False; Name=Test-Group;
Notes=$null; OrganizationalUnit=gbrp265a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/tenantname.onmicrosoft.com; PrimarySmtpAddres
s=Test-Group@tenantname.onmicrosoft.com; RequireSenderAuthenticationEnabled=True; RoomList=$null; SendModerationNotifications=Always; TenantId=
; Type=$null
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Current Values: Alias=Test-Group; ApplicationId=;
BccBlocked=False; BypassNestedModerationEnabled=False; CertificatePassword=$null; CertificatePath=; CertificateThumbprint=; Credential=; Descripti
on=$null; DisplayName=Test-Group; Ensure=Present; HiddenGroupMembershipEnabled=False; ManagedBy=user.name; Managedidentity=False; MemberDepartRestric
tion=Closed; MemberJoinRestriction=Closed; Members=$null; ModeratedBy=; ModerationEnabled=False; Name=Test-Group; Notes=$null; OrganizationalUnit=gbrp26
5a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/tenantname.onmicrosoft.com; PrimarySmtpAddress=Test-Group@mafinternational.onmicros
oft.com; RequireSenderAuthenticationEnabled=True; RoomList=$null; SendModerationNotifications=Always; TenantId=; Type=$null
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Target Values: Alias=Test-Group; Credential=; Ensu
re=Present; Name=Test-Group; Type=Security; Verbose=True
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Test-TargetResource returned False
VERBOSE: [COMPUTERNAME]: LCM: [ End Test ] [[EXODistributionGroup]MailEnabledSecurityGroup] in 12.4050 seconds.
VERBOSE: [COMPUTERNAME]: LCM: [ Start Set ] [[EXODistributionGroup]MailEnabledSecurityGroup]
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Setting Distribution Group configuration for {Test-Gr
oup}
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Getting configuration of Distribution Group for Test-
Group
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Found Distribution Group Test-Group
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Get-TargetResource Result:
Alias=Test-Group; ApplicationId=; BccBlocked=False; BypassNestedModerationEnabled=False; CertificatePassword=$null; CertificatePath=; Certificate
Thumbprint=; Credential=; Description=$null; DisplayName=Test-Group; Ensure=Present; HiddenGroupMembershipEnabled=False; ManagedBy=user.name; Mana
gedidentity=False; MemberDepartRestriction=Closed; MemberJoinRestriction=Closed; Members=$null; ModeratedBy=; ModerationEnabled=False; Name=Test-Group;
Notes=$null; OrganizationalUnit=gbrp265a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/tenantname.onmicrosoft.com; PrimarySmtpAddres
s=Test-Group@tenantname.onmicrosoft.com; RequireSenderAuthenticationEnabled=True; RoomList=$null; SendModerationNotifications=Always; TenantId=***
; Type=$null
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] The Distribution Group {Test-Group} already exists. U
pdating settings
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Setting Distribution Group {Test-Group} with values:
Alias=Test-Group; Name=Test-Group; Type=Security; Verbose=True
WARNING: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Desired and current OrganizationalUnit values differ.
This property cannot be updated once the distribution group has been created. Delete and recreate the distribution group to update the value.
A parameter cannot be found that matches parameter name 'Type'.
+ CategoryInfo : InvalidArgument: (:) [], CimException
+ FullyQualifiedErrorId : NamedParameterNotFound,Set-DistributionGroup
+ PSComputerName : localhost
VERBOSE: [COMPUTERNAME]: LCM: [ End Set ] [[EXODistributionGroup]MailEnabledSecurityGroup] in 0.7530 seconds.
The PowerShell DSC resource '[EXODistributionGroup]MailEnabledSecurityGroup' with SourceInfo 'C:\Users\user.name\Documents\MAFINT Azure AD
Automation\DscConfigurations\Example.ps1::16::9::EXODistributionGroup' threw one or more non-terminating errors while running the Set-TargetResource
functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost
Suggested solution to the issue
It appears that the module presumes that the Group Type will be returned in a 'Type' variable from Get-DistributionGroup. However, this value ought to be determined from one of GroupType, RecipientType or RecipientTypeDetails instead.
It is not clear to me why the Set script is triggering for OrganizationalUnit.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
$credsCredential=Get-CredentialConfigurationExample
{
Import-DscResource-ModuleName Microsoft365DSC
node localhost
{
EXODistributionGroup 'MailEnabledSecurityGroup'
{
Credential =$credsCredential;
Name ="Test-Group";
Alias ="Test-Group";
Type ="Security";
Ensure ="Present";
}
}
}
$cd=@{
AllNodes=@(
@{
NodeName='localhost'PSDscAllowPlainTextPassword=$true
}
)
}
Example -ConfigurationData $cd
Details of the scenario you tried and the problem that is occurring
Trying to use the 'EXODistributionGroup' module to create a mail-enabled security group.
Test-TargetResource always returns False which results in DSC attempting to (incorrectly) reconfigure the group.
There are also some errors regarding the 'OrganizationUnit' values differing despite the DSC configuration failing to request an update to these in any way.
Verbose logs showing the problem
VERBOSE: [COMPUTERNAME]: LCM: [ Start Resource ] [[EXODistributionGroup]MailEnabledSecurityGroup]
VERBOSE: [COMPUTERNAME]: LCM: [ Start Test ] [[EXODistributionGroup]MailEnabledSecurityGroup]
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Testing Distribution Group configuration for {Test-Gr
oup}
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Getting configuration of Distribution Group for Test-
Group
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Found Distribution Group Test-Group
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Get-TargetResource Result:
Alias=Test-Group; ApplicationId=; BccBlocked=False; BypassNestedModerationEnabled=False; CertificatePassword=$null; CertificatePath=; Certificate
Thumbprint=; Credential=; Description=$null; DisplayName=Test-Group; Ensure=Present; HiddenGroupMembershipEnabled=False; ManagedBy=user.name; Mana
gedidentity=False; MemberDepartRestriction=Closed; MemberJoinRestriction=Closed; Members=$null; ModeratedBy=; ModerationEnabled=False; Name=Test-Group;
Notes=$null; OrganizationalUnit=gbrp265a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/tenantname.onmicrosoft.com; PrimarySmtpAddres
s=Test-Group@tenantname.onmicrosoft.com; RequireSenderAuthenticationEnabled=True; RoomList=$null; SendModerationNotifications=Always; TenantId=
; Type=$null
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Current Values: Alias=Test-Group; ApplicationId=;
BccBlocked=False; BypassNestedModerationEnabled=False; CertificatePassword=$null; CertificatePath=; CertificateThumbprint=; Credential=; Descripti
on=$null; DisplayName=Test-Group; Ensure=Present; HiddenGroupMembershipEnabled=False; ManagedBy=user.name; Managedidentity=False; MemberDepartRestric
tion=Closed; MemberJoinRestriction=Closed; Members=$null; ModeratedBy=; ModerationEnabled=False; Name=Test-Group; Notes=$null; OrganizationalUnit=gbrp26
5a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/tenantname.onmicrosoft.com; PrimarySmtpAddress=Test-Group@mafinternational.onmicros
oft.com; RequireSenderAuthenticationEnabled=True; RoomList=$null; SendModerationNotifications=Always; TenantId=; Type=$null
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Target Values: Alias=Test-Group; Credential=; Ensu
re=Present; Name=Test-Group; Type=Security; Verbose=True
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Test-TargetResource returned False
VERBOSE: [COMPUTERNAME]: LCM: [ End Test ] [[EXODistributionGroup]MailEnabledSecurityGroup] in 12.4050 seconds.
VERBOSE: [COMPUTERNAME]: LCM: [ Start Set ] [[EXODistributionGroup]MailEnabledSecurityGroup]
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Setting Distribution Group configuration for {Test-Gr
oup}
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Getting configuration of Distribution Group for Test-
Group
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Found Distribution Group Test-Group
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Get-TargetResource Result:
Alias=Test-Group; ApplicationId=; BccBlocked=False; BypassNestedModerationEnabled=False; CertificatePassword=$null; CertificatePath=; Certificate
Thumbprint=; Credential=; Description=$null; DisplayName=Test-Group; Ensure=Present; HiddenGroupMembershipEnabled=False; ManagedBy=user.name; Mana
gedidentity=False; MemberDepartRestriction=Closed; MemberJoinRestriction=Closed; Members=$null; ModeratedBy=; ModerationEnabled=False; Name=Test-Group;
Notes=$null; OrganizationalUnit=gbrp265a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/tenantname.onmicrosoft.com; PrimarySmtpAddres
s=Test-Group@tenantname.onmicrosoft.com; RequireSenderAuthenticationEnabled=True; RoomList=$null; SendModerationNotifications=Always; TenantId=***
; Type=$null
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] The Distribution Group {Test-Group} already exists. U
pdating settings
VERBOSE: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Setting Distribution Group {Test-Group} with values:
Alias=Test-Group; Name=Test-Group; Type=Security; Verbose=True
WARNING: [COMPUTERNAME]: [[EXODistributionGroup]MailEnabledSecurityGroup] Desired and current OrganizationalUnit values differ.
This property cannot be updated once the distribution group has been created. Delete and recreate the distribution group to update the value.
A parameter cannot be found that matches parameter name 'Type'.
+ CategoryInfo : InvalidArgument: (:) [], CimException
+ FullyQualifiedErrorId : NamedParameterNotFound,Set-DistributionGroup
+ PSComputerName : localhost
VERBOSE: [COMPUTERNAME]: LCM: [ End Set ] [[EXODistributionGroup]MailEnabledSecurityGroup] in 0.7530 seconds.
The PowerShell DSC resource '[EXODistributionGroup]MailEnabledSecurityGroup' with SourceInfo 'C:\Users\user.name\Documents\MAFINT Azure AD
Automation\DscConfigurations\Example.ps1::16::9::EXODistributionGroup' threw one or more non-terminating errors while running the Set-TargetResource
functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost
Suggested solution to the issue
It appears that the module presumes that the Group Type will be returned in a 'Type' variable from Get-DistributionGroup. However, this value ought to be determined from one of GroupType, RecipientType or RecipientTypeDetails instead.
It is not clear to me why the Set script is triggering for OrganizationalUnit.
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.22.1214.1
The text was updated successfully, but these errors were encountered: