Skip to content
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

SCAutoSensitivityLabelPolicy - Create Auto Label Policy fails with errors on Test-TargetResource #4283

Closed
tayhall opened this issue Feb 2, 2024 · 1 comment · Fixed by #4620 or #4674
Labels
Bug Something isn't working Security & Compliance Center V1.24.124.1 Version 1.24.124.1

Comments

@tayhall
Copy link
Contributor

tayhall commented Feb 2, 2024

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

@tayhall tayhall changed the title SCAutoSensitivityLabelPolicy - Create Labels fails with errors on Test-TargetResource SCAutoSensitivityLabelPolicy - Create Auto Label Policy fails with errors on Test-TargetResource Feb 2, 2024
@andikrueger andikrueger added Bug Something isn't working Security & Compliance Center V1.24.124.1 Version 1.24.124.1 labels Feb 6, 2024
ykuijs added a commit to ykuijs/Microsoft365DSC that referenced this issue Apr 30, 2024
@ykuijs
Copy link
Member

ykuijs commented Apr 30, 2024

Issue is caused by the fact that the Credential parameter is specified (incorrectly) as Mandatory in the Set and Test method. Submitting a PR to fix this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Security & Compliance Center V1.24.124.1 Version 1.24.124.1
Projects
None yet
3 participants