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

Extracting SCAutoSensitivityLabelRule showing error #4617

Open
MartinTrnka opened this issue Apr 29, 2024 · 2 comments
Open

Extracting SCAutoSensitivityLabelRule showing error #4617

MartinTrnka opened this issue Apr 29, 2024 · 2 comments

Comments

@MartinTrnka
Copy link

Description of the issue

I am not able to save SCAutoSensitivityLabelRule,
others like @("SCLabelPolicy", "SCSensitivityLabel" are OK

Microsoft 365 DSC Version

1.24.424.1

Which workloads are affected

Security & Compliance Center

The DSC configuration

$Components = @("SCLabelPolicy", "SCSensitivityLabel","SCAutoSensitivityLabelRule")
foreach ($component in $Components){
    Export-M365DSCConfiguration `
        -Credential $SourceCredential `
        -Path $($ExportPath + "\" +$Component) `
        -ConfigurationName $SourceTenantName `
        -Components $Component
        }

Verbose logs showing the problem

[2024.04.29 04:50:28]
{InvalidData}
System.Management.Automation.ParameterBindingValidationException: Cannot validate argument on parameter 'Workload'. The argument "Applications" does not belong to the set "Exchange;SharePoint;OneDriveForBusiness" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. ---> System.Management.Automation.ValidationMetadataException: The argument "Applications" does not belong to the set "Exchange;SharePoint;OneDriveForBusiness" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.
   v System.Management.Automation.ValidateSetAttribute.ValidateElement(Object element)
   v System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
   --- Konec trasování zásobníku pro vnitřní výjimku ---
   v System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   v System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   v System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   v System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
"Error during Export:"
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.424.1\DSCResources\MSFT_SCAutoSensitivityLabelRule\MSFT_SCAutoSensitivityLabelRule.psm1: line 1141
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.424.1\Modules\M365DSCReverse.psm1: line 677
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.424.1\Modules\M365DSCUtil.psm1: line 1375

Environment Information + PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.22621.2506
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.2506
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
@michaelbaltes
Copy link

I have a similar error when exporting "SCSensitivityLabel" or "SCLabelPolicy".

I have tried it with login and with SPN. In both cases the result was the same.

Sorry its german:
System.Management.Automation.CommandNotFoundException: Die Benennung "Get-Label" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern enthalten), und wiederholen Sie den Vorgang.
bei System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
bei System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
bei System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
bei System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
"Error during Export:"
bei Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.424.1\DSCResources\MSFT_SCSensitivityLabel\MSFT_SCSensitivityLabel.psm1: Zeile 1202
bei Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.424.1\Modules\M365DSCReverse.psm1: Zeile 677
bei Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.424.1\Modules\M365DSCUtil.psm1: Zeile 1375

@michaelbaltes
Copy link

For me it was fixed with the new version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants