Microsoft365DSC
Microsoft365DSC copied to clipboard
SCAutoSensitivityLabelPolicy - Create Auto Label Policy fails with errors on Test-TargetResource
Description of the issue
Trying to create a new AutoSensitivityLabelPolicy based on an existing label fails on the Test-TargetResource (see logs below)
Creation of the same label using PowerShell works fine with just these values.
Microsoft 365 DSC Version
1.24.124.1
Which workloads are affected
Security & Compliance Center
The DSC configuration
# Generated with Microsoft365DSC version 1.24.124.1
# For additional information on how to use Microsoft365DSC, please visit https://aka.ms/M365DSC
param (
)
Configuration SCAutoSensitivityLabelPolicy
{
param (
)
$OrganizationName = $ConfigurationData.NonNodeData.OrganizationName
Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.24.124.1'
Node localhost
{
SCAutoSensitivityLabelPolicy "SCAutoSensitivityLabelPolicy-Inbound from External Domains"
{
ApplicationId = $ConfigurationData.NonNodeData.ApplicationId;
ApplySensitivityLabel = "SomeLabel99";
CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint;
Comment = "Auto Labelling policy to apply the label to inbound emails received from xx";
Ensure = "Present";
ExchangeLocation = @("All");
ExchangeSender = @();
ExchangeSenderException = @();
ExchangeSenderMemberOf = @();
ExchangeSenderMemberOfException = @();
Mode = "Enable";
Name = "Inbound from External Domains";
OneDriveLocation = @();
OneDriveLocationException = @();
Priority = 0;
SharePointLocation = @();
SharePointLocationException = @();
TenantId = $OrganizationName;
}
}
}
SCAutoSensitivityLabelPolicy -ConfigurationData .\ConfigurationData.psd1
Verbose logs showing the problem
VERBOSE: An LCM method call arrived from computer PANTHER with user sid S-xxx.
VERBOSE: [SomePC]: LCM: [ Start Set ]
VERBOSE: [SomePC]: LCM: [ Start Resource ] [[SCAutoSensitivityLabelPolicy]SCAutoSensitivityLabelPolicy-Inbound from External Domains]
VERBOSE: [SomePC]: LCM: [ Start Test ] [[SCAutoSensitivityLabelPolicy]SCAutoSensitivityLabelPolicy-Inbound from External Domains]
VERBOSE: [SomePC]: LCM: [ End Test ] [[SCAutoSensitivityLabelPolicy]SCAutoSensitivityLabelPolicy-Inbound from External Domains] in 0.1110 seconds.
PowerShell DSC resource MSFT_SCAutoSensitivityLabelPolicy failed to execute Test-TargetResource functionality with error message: PowerShell Desired State Configuration
does not support execution of commands in an interactive mode. Please ensure that the underlying command is not prompting for user input, such as missing mandatory
parameter, confirmation prompt etc.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost
VERBOSE: [SomePC]: LCM: [ End Set ]
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : localhost
VERBOSE: Operation 'Invoke CimMethod' complete.
Environment Information + PowerShell Version
No response