microsoft / Microsoft365DSC

Manages, configures, extracts and monitors Microsoft 365 tenant configurations
https://aka.ms/M365DSC
MIT License
1.46k stars 440 forks source link

Security & Compliance: MSFT_SCDLPCompliancePolicy Error #4689

Open AdamSystima opened 1 month ago

AdamSystima commented 1 month ago

Description of the issue

I have been able to successfully export Compliance Policies using the command;

Export-M365DSCConfiguration -Components @("SCDLPCompliancePolicy", "SCDLPComplianceRule") -Credential $Credential

Generate the MOF file by running;

.\M365TenantConfig.ps1 -Credential $Credential

But I am seeing an error upon trying to import the configuration using;

Start-DscConfiguration -Path C:\temp\dlp\M365TenantConfig\ -Wait -Verbose -Force

Running Get-DscResource -Module Microsoft365DSC does return both SCDLP resources.

PowerShell SCDLPCompliancePolicy Microsoft365DSC 1.24.515.2 PowerShell SCDLPComplianceRule Microsoft365DSC 1.24.515.2

Microsoft 365 DSC Version

1.24.515.2

Which workloads are affected

Security & Compliance Center

The DSC configuration

I am exporting the DLP policies using an Enterprise cdx environment. There is nothing custom in the policies.

Verbose logs showing the problem

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' =
SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' =
root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer ADAMS-ROG-X13 with user sid
S-1-12-1-2222815654-1275822311-3203297921-1732033822.
VERBOSE: [ADAMS-ROG-X13]: LCM:  [ Start  Set      ]
VERBOSE: [ADAMS-ROG-X13]: LCM:  [ End    Set      ]
The PowerShell DSC resource MSFT_SCDLPCompliancePolicy from module <Microsoft365DSC,1.24.515.2> does not exist at the
PowerShell module path nor is it registered as a WMI DSC resource.
    + CategoryInfo          : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : DscResourceNotFound
    + PSComputerName        : localhost

VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 0.909 seconds

Environment Information + PowerShell Version

OsName               : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 26100.1.amd64fre.ge_release.240331-1435
OsLanguage           : en-US
OsMuiLanguages       : {en-US, en-GB}

Name                           Value
----                           -----
PSVersion                      5.1.26100.461
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.26100.461
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
michaelbaltes commented 1 month ago

I got a similar bug. { The term 'Get-Label' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. } \ at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.515.2\DscResources\MSFT_SCSensitivityLabel\MSFT_SCSensitivityLabel.psm1: line 251

Other modules as EXO or AzureAD have no errors. Only "Security and Compliance".