microsoft / Microsoft365DSC

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

SCRetentionCompliancePolicy not in desired state output false but the settings where correctly applied/configured in a tenant #2179

Closed atdheekurteshi closed 2 years ago

atdheekurteshi commented 2 years ago

Details of the scenario you tried and the problem that is occurring

SCRetentionCompliancePolicy below settings are correctly applied/configured in our tenant but I don't understand why are they 'NotInDesiredState'.

When I run the following commands in the Power-Shell everything seems to be working fine for SCRetentionCompliancePolicy:

Publish-DscConfiguration -Path C:\...\MOFs\MainConfig -Force
Start-DscConfiguration -UseExisting -Force -Verbose -Wait
$res=Test-DscConfiguration -ComputerName localhost -Detailed -Verbose

but the following Power-Shell command

PS C:\Windows\system32> $res.ResourcesNotInDesiredState

ConfigurationName    : MainConfig
DependsOn            :
ModuleName           : Microsoft365DSC
ModuleVersion        : 1.22.720.1
PsDscRunAsCredential :
ResourceId           : [SCRetentionCompliancePolicy]Container-106-60488f15-bb59-47c4-bbae-a1c6476ac66f
SourceInfo           : ::18::3::SCRetentionCompliancePolicy
DurationInSeconds    : 8.219
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-106-60488f15-bb59-47c4-bbae-a1c6476ac66f
RebootRequested      : False
ResourceName         : SCRetentionCompliancePolicy
StartDate            : 8/5/2022 11:36:12 AM
StateChanged         : False
PSComputerName       : localhost

ConfigurationName    : MainConfig
DependsOn            :
ModuleName           : Microsoft365DSC
ModuleVersion        : 1.22.720.1
PsDscRunAsCredential :
ResourceId           : [SCRetentionCompliancePolicy]Container-107-c5322adc-7b19-4538-86f7-322838b905c3
SourceInfo           : ::28::3::SCRetentionCompliancePolicy
DurationInSeconds    : 3.969
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-107-c5322adc-7b19-4538-86f7-322838b905c3
RebootRequested      : False
ResourceName         : SCRetentionCompliancePolicy
StartDate            : 8/5/2022 11:36:20 AM
StateChanged         : False
PSComputerName       : localhost

ConfigurationName    : MainConfig
DependsOn            :
ModuleName           : Microsoft365DSC
ModuleVersion        : 1.22.720.1
PsDscRunAsCredential :
ResourceId           : [SCRetentionCompliancePolicy]Container-108-4068df3c-caed-45c1-bdff-7ad20cc9d344
SourceInfo           : ::38::3::SCRetentionCompliancePolicy
DurationInSeconds    : 0.687
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-108-4068df3c-caed-45c1-bdff-7ad20cc9d344
RebootRequested      : False
ResourceName         : SCRetentionCompliancePolicy
StartDate            : 8/5/2022 11:36:24 AM
StateChanged         : False
PSComputerName       : localhost

ConfigurationName    : MainConfig
DependsOn            :
ModuleName           : Microsoft365DSC
ModuleVersion        : 1.22.720.1
PsDscRunAsCredential :
ResourceId           : [SCRetentionComplianceRule]Container-110-5ab79cc9-613f-49a4-8fd0-7e69ab93fc5d
SourceInfo           : ::60::3::SCRetentionComplianceRule
DurationInSeconds    : 0.562
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-110-5ab79cc9-613f-49a4-8fd0-7e69ab93fc5d
RebootRequested      : False
ResourceName         : SCRetentionComplianceRule
StartDate            : 8/5/2022 11:36:26 AM
StateChanged         : False
PSComputerName       : localhost

PS C:\Windows\system32> $res.ResourcesNotInDesiredState | select ResourceId

ResourceId
----------
[SCRetentionCompliancePolicy]Container-106-60488f15-bb59-47c4-bbae-a1c6476ac66f
[SCRetentionCompliancePolicy]Container-107-c5322adc-7b19-4538-86f7-322838b905c3
[SCRetentionCompliancePolicy]Container-108-4068df3c-caed-45c1-bdff-7ad20cc9d344
[SCRetentionComplianceRule]Container-110-5ab79cc9-613f-49a4-8fd0-7e69ab93fc5d

outputs the SCRetentionCompliancePolicy not in desired state

The DSC configuration that is used to reproduce the issue (as detailed as possible)

MOF file extract:

/*
@TargetNode='localhost'
@GeneratedBy=xxx
@GenerationDate=
@GenerationHost=xxx
*/

instance of MSFT_Credential as $MSFT_Credential1ref
{
Password = "";
UserName = "";
};

instance of MSFT_SCRetentionCompliancePolicy as $MSFT_SCRetentionCompliancePolicy1ref
{
ResourceID = "[SCRetentionCompliancePolicy]Container-106-60488f15-bb59-47c4-bbae-a1c6476ac66f";
 Enabled = False;
 Credential = $MSFT_Credential1ref;
 Ensure = "Present";
 Comment = "Standard Aufbewahrungsfrist für Exchange Online 93 Tage";
 SourceInfo = "::18::3::SCRetentionCompliancePolicy";
 Name = "Exchange Online Standard Retention Policy";
 ModuleName = "Microsoft365DSC";
 RestrictiveRetention = False;
 ExchangeLocation = {
    "All"
};
 ModuleVersion = "1.22.720.1";

 ConfigurationName = "MainConfig";

};
instance of MSFT_Credential as $MSFT_Credential2ref
{
Password = "";
UserName = "";
};

instance of MSFT_SCRetentionCompliancePolicy as $MSFT_SCRetentionCompliancePolicy2ref
{
ResourceID = "[SCRetentionCompliancePolicy]Container-107-c5322adc-7b19-4538-86f7-322838b905c3";
TeamsChatLocation = {
    "All"
};
 Enabled = False;
 Credential = $MSFT_Credential2ref;
 Ensure = "Present";
 Comment = "Standard Aufbewahrungsrichtlinie für Microsoft Teams Chat Protokolle";
 SourceInfo = "::28::3::SCRetentionCompliancePolicy";
 Name = "Microsoft Teams Chat Standard Retention Policy";
 ModuleName = "Microsoft365DSC";
 RestrictiveRetention = False;
 ModuleVersion = "1.22.720.1";

 ConfigurationName = "MainConfig";

};
instance of MSFT_Credential as $MSFT_Credential3ref
{
Password = "";
UserName = "";
};

instance of MSFT_SCRetentionCompliancePolicy as $MSFT_SCRetentionCompliancePolicy3ref
{
ResourceID = "[SCRetentionCompliancePolicy]Container-108-4068df3c-caed-45c1-bdff-7ad20cc9d344";
 Enabled = True;
 Credential = $MSFT_Credential3ref;
 Ensure = "Present";
 Comment = "Standard Aufbewahrungsrichtlinie für Microsoft OneDrive";
 SharePointLocation = {
    "All"
};
 SourceInfo = "::38::3::SCRetentionCompliancePolicy";
 Name = "OneDrive Standard Retention Policy";
 ModuleName = "Microsoft365DSC";
 RestrictiveRetention = False;
 OneDriveLocation = {
    "All"
};
 ModuleVersion = "1.22.720.1";

 ConfigurationName = "MainConfig";

};
instance of MSFT_Credential as $MSFT_Credential4ref
{
Password = "";
UserName = "";
};

instance of MSFT_SCRetentionComplianceRule as $MSFT_SCRetentionComplianceRule1ref
{
ResourceID = "[SCRetentionComplianceRule]Container-109-a192156a-22ae-4cdb-8010-ee370f2816c4";
 ExpirationDateOption = "ModificationAgeInDays";
 RetentionDurationDisplayHint = "Days";
 Ensure = "Present";
 RetentionDuration = "93";
 Policy = "Exchange Online Standard Retention Policy";
 SourceInfo = "::49::3::SCRetentionComplianceRule";
 Name = "Exchange Online Standard Retention Rule";
 ModuleName = "Microsoft365DSC";
 RetentionComplianceAction = "Keep";
 Credential = $MSFT_Credential4ref;
 ModuleVersion = "1.22.720.1";

 ConfigurationName = "MainConfig";

};
instance of MSFT_Credential as $MSFT_Credential5ref
{
Password = "";
UserName = "";
};

instance of MSFT_SCRetentionComplianceRule as $MSFT_SCRetentionComplianceRule2ref
{
ResourceID = "[SCRetentionComplianceRule]Container-110-5ab79cc9-613f-49a4-8fd0-7e69ab93fc5d";
 ExpirationDateOption = "CreationAgeInDays";
 RetentionDurationDisplayHint = "Days";
 Ensure = "Present";
 RetentionDuration = "730";
 Policy = "Microsoft Teams Chat Standard Retention Policy";
 SourceInfo = "::60::3::SCRetentionComplianceRule";
 Name = "Microsoft Teams Chat Standard Retention Rule";
 ModuleName = "Microsoft365DSC";
 RetentionComplianceAction = "KeepAndDelete";
 Credential = $MSFT_Credential5ref;
 ModuleVersion = "1.22.720.1";

 ConfigurationName = "MainConfig";

};
instance of MSFT_Credential as $MSFT_Credential6ref
{
Password = "";
UserName = "";
};

instance of MSFT_SCRetentionComplianceRule as $MSFT_SCRetentionComplianceRule3ref
{
ResourceID = "[SCRetentionComplianceRule]Container-111-96ccd1d5-cfc5-4a3e-a1d7-718b186080e6";
 ExpirationDateOption = "ModificationAgeInDays";
 RetentionDurationDisplayHint = "Days";
 Ensure = "Present";
 RetentionDuration = "93";
 Policy = "OneDrive Standard Retention Policy";
 SourceInfo = "::71::3::SCRetentionComplianceRule";
 Name = "OneDrive Standard Retention Rule";
 ModuleName = "Microsoft365DSC";
 RetentionComplianceAction = "Keep";
 Credential = $MSFT_Credential6ref;
 ModuleVersion = "1.22.720.1";

 ConfigurationName = "MainConfig";

};
instance of OMI_ConfigurationDocument

                    {
 Version="2.0.0";

                        MinimumCompatibleVersion = "1.0.0";

                        CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationName"};

                        Author="";

                        GenerationDate="";

                        GenerationHost="xxx";

                        ContentType="PasswordEncrypted";

                        Name="MainConfig";

                    };
#### The operating system the target node is running
<!--
    Please provide as much as possible about the target node, for example
    edition, version, build and language.
    On OS with WMF 5.1 the following command can help get this information.

OsName               : Microsoft Windows 10 Pro
OsOperatingSystemSKU : 48
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage           : en-US
OsMuiLanguages       : {en-US, de-DE}

-->

#### Version of the DSC module that was used ('dev' if using current dev branch)
1.22.720.1
andikrueger commented 2 years ago

Could you share the verbose log of the Test-DSCConfiguration or the Event Log items? Within the Windows Event Log there should be a full overview of which settings are marked as drifted.

atdheekurteshi commented 2 years ago

@andikrueger

Here it is: Log Name: M365DSC Source: MSFT_SCRetentionComplianceRule Date: 8/5/2022 11:32:05 AM Event ID: 1 Task Category: (1) Level: Warning Keywords: Classic User: N/A Computer:
Description:

AbsentPresent OneDrive Standard Retention Rule OneDrive Standard Retention Policy Present ModificationAgeInDays Keep 93 Days True

Event Xml:

1 0 3 1 0 0x80000000000000 1975 M365DSC <M365DSCEvent> <ConfigurationDrift Source="MSFT_SCRetentionComplianceRule"> <ParametersNotInDesiredState> <Param Name="Ensure"><CurrentValue>Absent</CurrentValue><DesiredValue>Present</DesiredValue></Param> </ParametersNotInDesiredState> </ConfigurationDrift> <DesiredValues> <Param Name ="Name">OneDrive Standard Retention Rule</Param> <Param Name ="Policy">OneDrive Standard Retention Policy</Param> <Param Name ="Ensure">Present</Param> <Param Name ="ExpirationDateOption">ModificationAgeInDays</Param> <Param Name ="RetentionComplianceAction">Keep</Param> <Param Name ="RetentionDuration">93</Param> <Param Name ="RetentionDurationDisplayHint">Days</Param> <Param Name ="Verbose">True</Param> </DesiredValues> </M365DSCEvent> Log Name: M365DSC Source: MSFT_SCRetentionComplianceRule Date: 8/5/2022 11:32:03 AM Event ID: 1 Task Category: (1) Level: Warning Keywords: Classic User: N/A Computer: Description: AbsentPresent Microsoft Teams Chat Standard Retention Rule Microsoft Teams Chat Standard Retention Policy Present CreationAgeInDays KeepAndDelete 730 Days True Event Xml: 1 0 3 1 0 0x80000000000000 1974 M365DSC <M365DSCEvent> <ConfigurationDrift Source="MSFT_SCRetentionComplianceRule"> <ParametersNotInDesiredState> <Param Name="Ensure"><CurrentValue>Absent</CurrentValue><DesiredValue>Present</DesiredValue></Param> </ParametersNotInDesiredState> </ConfigurationDrift> <DesiredValues> <Param Name ="Name">Microsoft Teams Chat Standard Retention Rule</Param> <Param Name ="Policy">Microsoft Teams Chat Standard Retention Policy</Param> <Param Name ="Ensure">Present</Param> <Param Name ="ExpirationDateOption">CreationAgeInDays</Param> <Param Name ="RetentionComplianceAction">KeepAndDelete</Param> <Param Name ="RetentionDuration">730</Param> <Param Name ="RetentionDurationDisplayHint">Days</Param> <Param Name ="Verbose">True</Param> </DesiredValues> </M365DSCEvent> Log Name: M365DSC Source: MSFT_SCRetentionComplianceRule Date: 8/5/2022 11:32:00 AM Event ID: 1 Task Category: (1) Level: Warning Keywords: Classic User: N/A Computer: Description: AbsentPresent Exchange Online Standard Retention Rule Exchange Online Standard Retention Policy Present ModificationAgeInDays Keep 93 Days True Event Xml: 1 0 3 1 0 0x80000000000000 1973 M365DSC <M365DSCEvent> <ConfigurationDrift Source="MSFT_SCRetentionComplianceRule"> <ParametersNotInDesiredState> <Param Name="Ensure"><CurrentValue>Absent</CurrentValue><DesiredValue>Present</DesiredValue></Param> </ParametersNotInDesiredState> </ConfigurationDrift> <DesiredValues> <Param Name ="Name">Exchange Online Standard Retention Rule</Param> <Param Name ="Policy">Exchange Online Standard Retention Policy</Param> <Param Name ="Ensure">Present</Param> <Param Name ="ExpirationDateOption">ModificationAgeInDays</Param> <Param Name ="RetentionComplianceAction">Keep</Param> <Param Name ="RetentionDuration">93</Param> <Param Name ="RetentionDurationDisplayHint">Days</Param> <Param Name ="Verbose">True</Param> </DesiredValues> </M365DSCEvent> Log Name: M365DSC Source: MSFT_SCRetentionCompliancePolicy Date: 8/5/2022 11:31:57 AM Event ID: 1 Task Category: (1) Level: Warning Keywords: Classic User: N/A Computer: Description: AbsentPresent OneDrive Standard Retention Policy Present Standard Aufbewahrungsrichtlinie für Microsoft OneDrive True All False All True Event Xml: 1 0 3 1 0 0x80000000000000 1972 M365DSC <M365DSCEvent> <ConfigurationDrift Source="MSFT_SCRetentionCompliancePolicy"> <ParametersNotInDesiredState> <Param Name="Ensure"><CurrentValue>Absent</CurrentValue><DesiredValue>Present</DesiredValue></Param> </ParametersNotInDesiredState> </ConfigurationDrift> <DesiredValues> <Param Name ="Name">OneDrive Standard Retention Policy</Param> <Param Name ="Ensure">Present</Param> <Param Name ="Comment">Standard Aufbewahrungsrichtlinie für Microsoft OneDrive</Param> <Param Name ="Enabled">True</Param> <Param Name ="OneDriveLocation">All</Param> <Param Name ="RestrictiveRetention">False</Param> <Param Name ="SharePointLocation">All</Param> <Param Name ="Verbose">True</Param> </DesiredValues> </M365DSCEvent> Log Name: M365DSC Source: MSFT_SCRetentionCompliancePolicy Date: 8/5/2022 11:31:55 AM Event ID: 1 Task Category: (1) Level: Warning Keywords: Classic User: N/A Computer: Description: AbsentPresent Microsoft Teams Chat Standard Retention Policy Present Standard Aufbewahrungsrichtlinie für Microsoft Teams Chat Protokolle False False All True Event Xml: 1 0 3 1 0 0x80000000000000 1971 M365DSC <M365DSCEvent> <ConfigurationDrift Source="MSFT_SCRetentionCompliancePolicy"> <ParametersNotInDesiredState> <Param Name="Ensure"><CurrentValue>Absent</CurrentValue><DesiredValue>Present</DesiredValue></Param> </ParametersNotInDesiredState> </ConfigurationDrift> <DesiredValues> <Param Name ="Name">Microsoft Teams Chat Standard Retention Policy</Param> <Param Name ="Ensure">Present</Param> <Param Name ="Comment">Standard Aufbewahrungsrichtlinie für Microsoft Teams Chat Protokolle</Param> <Param Name ="Enabled">False</Param> <Param Name ="RestrictiveRetention">False</Param> <Param Name ="TeamsChatLocation">All</Param> <Param Name ="Verbose">True</Param> </DesiredValues> </M365DSCEvent> Log Name: M365DSC Source: MSFT_SCRetentionCompliancePolicy Date: 8/5/2022 11:31:50 AM Event ID: 1 Task Category: (1) Level: Warning Keywords: Classic User: N/A Computer: Description: AbsentPresent Exchange Online Standard Retention Policy Present Standard Aufbewahrungsfrist für Exchange Online 93 Tage False All False True Event Xml: 1 0 3 1 0 0x80000000000000 1970 M365DSC <M365DSCEvent> <ConfigurationDrift Source="MSFT_SCRetentionCompliancePolicy"> <ParametersNotInDesiredState> <Param Name="Ensure"><CurrentValue>Absent</CurrentValue><DesiredValue>Present</DesiredValue></Param> </ParametersNotInDesiredState> </ConfigurationDrift> <DesiredValues> <Param Name ="Name">Exchange Online Standard Retention Policy</Param> <Param Name ="Ensure">Present</Param> <Param Name ="Comment">Standard Aufbewahrungsfrist für Exchange Online 93 Tage</Param> <Param Name ="Enabled">False</Param> <Param Name ="ExchangeLocation">All</Param> <Param Name ="RestrictiveRetention">False</Param> <Param Name ="Verbose">True</Param> </DesiredValues> </M365DSCEvent>
andikrueger commented 2 years ago

This looks like to be connected to #2181.

Could you apply the configuration again and share the verbose log of the the five SCRetention... Resources that are mentioned above_

atdheekurteshi commented 2 years ago

@andikrueger

Here it is:

Log Name: M365DSC Source: MSFT_SCRetentionCompliancePolicy Date: 8/8/2022 11:38:41 AM Event ID: 1 Task Category: (1) Level: Warning Keywords: Classic User: N/A Computer:
Description:

All All OneDrive Standard Retention Policy Present Standard Aufbewahrungsrichtlinie für Microsoft OneDrive True All False All True

Event Xml:

1 0 3 1 0 0x80000000000000 2018 M365DSC <M365DSCEvent> <ConfigurationDrift Source="MSFT_SCRetentionCompliancePolicy"> <ParametersNotInDesiredState> <Param Name="SharePointLocation"><CurrentValue></CurrentValue><DesiredValue>All</DesiredValue></Param> <Param Name="OneDriveLocation"><CurrentValue></CurrentValue><DesiredValue>All</DesiredValue></Param> </ParametersNotInDesiredState> </ConfigurationDrift> <DesiredValues> <Param Name ="Name">OneDrive Standard Retention Policy</Param> <Param Name ="Ensure">Present</Param> <Param Name ="Comment">Standard Aufbewahrungsrichtlinie für Microsoft OneDrive</Param> <Param Name ="Enabled">True</Param> <Param Name ="OneDriveLocation">All</Param> <Param Name ="RestrictiveRetention">False</Param> <Param Name ="SharePointLocation">All</Param> <Param Name ="Verbose">True</Param> </DesiredValues> </M365DSCEvent> Log Name: M365DSC Source: MSFT_SCRetentionCompliancePolicy Date: 8/8/2022 11:38:40 AM Event ID: 1 Task Category: (1) Level: Warning Keywords: Classic User: N/A Computer: Description: All Exchange Online Standard Retention Policy Present Standard Aufbewahrungsfrist für Exchange Online 93 Tage False All False True Event Xml: 1 0 3 1 0 0x80000000000000 2017 M365DSC <M365DSCEvent> <ConfigurationDrift Source="MSFT_SCRetentionCompliancePolicy"> <ParametersNotInDesiredState> <Param Name="ExchangeLocation"><CurrentValue></CurrentValue><DesiredValue>All</DesiredValue></Param> </ParametersNotInDesiredState> </ConfigurationDrift> <DesiredValues> <Param Name ="Name">Exchange Online Standard Retention Policy</Param> <Param Name ="Ensure">Present</Param> <Param Name ="Comment">Standard Aufbewahrungsfrist für Exchange Online 93 Tage</Param> <Param Name ="Enabled">False</Param> <Param Name ="ExchangeLocation">All</Param> <Param Name ="RestrictiveRetention">False</Param> <Param Name ="Verbose">True</Param> </DesiredValues> </M365DSCEvent> Log Name: M365DSC Source: MSFT_SCRetentionComplianceRule Date: 8/8/2022 11:38:31 AM Event ID: 1 Task Category: (1) Level: Warning Keywords: Classic User: N/A Computer: Description: AbsentPresent OneDrive Standard Retention Rule OneDrive Standard Retention Policy Present ModificationAgeInDays Keep 93 Days True Event Xml: 1 0 3 1 0 0x80000000000000 2016 M365DSC <M365DSCEvent> <ConfigurationDrift Source="MSFT_SCRetentionComplianceRule"> <ParametersNotInDesiredState> <Param Name="Ensure"><CurrentValue>Absent</CurrentValue><DesiredValue>Present</DesiredValue></Param> </ParametersNotInDesiredState> </ConfigurationDrift> <DesiredValues> <Param Name ="Name">OneDrive Standard Retention Rule</Param> <Param Name ="Policy">OneDrive Standard Retention Policy</Param> <Param Name ="Ensure">Present</Param> <Param Name ="ExpirationDateOption">ModificationAgeInDays</Param> <Param Name ="RetentionComplianceAction">Keep</Param> <Param Name ="RetentionDuration">93</Param> <Param Name ="RetentionDurationDisplayHint">Days</Param> <Param Name ="Verbose">True</Param> </DesiredValues> </M365DSCEvent> Log Name: M365DSC Source: MSFT_SCRetentionComplianceRule Date: 8/8/2022 11:38:27 AM Event ID: 1 Task Category: (1) Level: Warning Keywords: Classic User: N/A Computer: Description: AbsentPresent Exchange Online Standard Retention Rule Exchange Online Standard Retention Policy Present ModificationAgeInDays Keep 93 Days True Event Xml: 1 0 3 1 0 0x80000000000000 2015 M365DSC <M365DSCEvent> <ConfigurationDrift Source="MSFT_SCRetentionComplianceRule"> <ParametersNotInDesiredState> <Param Name="Ensure"><CurrentValue>Absent</CurrentValue><DesiredValue>Present</DesiredValue></Param> </ParametersNotInDesiredState> </ConfigurationDrift> <DesiredValues> <Param Name ="Name">Exchange Online Standard Retention Rule</Param> <Param Name ="Policy">Exchange Online Standard Retention Policy</Param> <Param Name ="Ensure">Present</Param> <Param Name ="ExpirationDateOption">ModificationAgeInDays</Param> <Param Name ="RetentionComplianceAction">Keep</Param> <Param Name ="RetentionDuration">93</Param> <Param Name ="RetentionDurationDisplayHint">Days</Param> <Param Name ="Verbose">True</Param> </DesiredValues> </M365DSCEvent> Log Name: M365DSC Source: MSFT_SCRetentionComplianceRule Date: 8/8/2022 11:29:17 AM Event ID: 1 Task Category: (1) Level: Warning Keywords: Classic User: N/A Computer: Description: AbsentPresent Microsoft Teams Chat Standard Retention Rule Microsoft Teams Chat Standard Retention Policy Present CreationAgeInDays KeepAndDelete 730 Days True Event Xml: 1 0 3 1 0 0x80000000000000 2012 M365DSC <M365DSCEvent> <ConfigurationDrift Source="MSFT_SCRetentionComplianceRule"> <ParametersNotInDesiredState> <Param Name="Ensure"><CurrentValue>Absent</CurrentValue><DesiredValue>Present</DesiredValue></Param> </ParametersNotInDesiredState> </ConfigurationDrift> <DesiredValues> <Param Name ="Name">Microsoft Teams Chat Standard Retention Rule</Param> <Param Name ="Policy">Microsoft Teams Chat Standard Retention Policy</Param> <Param Name ="Ensure">Present</Param> <Param Name ="ExpirationDateOption">CreationAgeInDays</Param> <Param Name ="RetentionComplianceAction">KeepAndDelete</Param> <Param Name ="RetentionDuration">730</Param> <Param Name ="RetentionDurationDisplayHint">Days</Param> <Param Name ="Verbose">True</Param> </DesiredValues> </M365DSCEvent> Log Name: M365DSC Source: MSFT_SCRetentionCompliancePolicy Date: 8/8/2022 11:29:14 AM Event ID: 1 Task Category: (1) Level: Warning Keywords: Classic User: N/A Computer: Description: All Microsoft Teams Chat Standard Retention Policy Present Standard Aufbewahrungsrichtlinie für Microsoft Teams Chat Protokolle False False All True Event Xml: 1 0 3 1 0 0x80000000000000 2010 M365DSC <M365DSCEvent> <ConfigurationDrift Source="MSFT_SCRetentionCompliancePolicy"> <ParametersNotInDesiredState> <Param Name="TeamsChatLocation"><CurrentValue></CurrentValue><DesiredValue>All</DesiredValue></Param> </ParametersNotInDesiredState> </ConfigurationDrift> <DesiredValues> <Param Name ="Name">Microsoft Teams Chat Standard Retention Policy</Param> <Param Name ="Ensure">Present</Param> <Param Name ="Comment">Standard Aufbewahrungsrichtlinie für Microsoft Teams Chat Protokolle</Param> <Param Name ="Enabled">False</Param> <Param Name ="RestrictiveRetention">False</Param> <Param Name ="TeamsChatLocation">All</Param> <Param Name ="Verbose">True</Param> </DesiredValues> </M365DSCEvent>
andikrueger commented 2 years ago

I meant the verbose log of PowerShell:

Start-DSCConfiguration -UseExisting -wait -verbose -force
atdheekurteshi commented 2 years ago
PS C:\Windows\system32> Start-DscConfiguration -UseExisting -Force -Verbose -Wait
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ApplyConfiguration,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: Vom Computer '' mit Benutzer-SID '' ist ein LCM-Methodenaufruf eingegangen.
VERBOSE: []:                            [] Das Konsistenzmodul wird gestartet.
VERBOSE: []: LCM:  [ StartenRessource]  [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372]
VERBOSE: []: LCM:  [ StartenTesten   ]  [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372]
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372] Testing configuration of RetentionCompliancePolicy for Exchange Online Standard Retention Policy
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372] Getting configuration of RetentionCompliancePolicy for Exchange Online Standard Retention Policy
WARNING: []:                            [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372] Ihre Verbindung wurde an den folgenden URI umgeleitet: "https://deu01b.ps.compliance.protection.outlook.com/Powershell-LiveId?BasicAuthToOAuthConversion=true;PSVersion=5.1.19041.1682
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372] RetentionCompliancePolicy Exchange Online Standard Retention Policy does not exist.
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372] Current Values: Comment=Standard Aufbewahrungsfrist für Exchange Online 93 Tage; Credential=***; Enabled=False; Ensure=Absent; ExchangeLocation=(All); Name=Exchange Online Standard Retention Policy; RestrictiveRetention=False;
Verbose=True
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372] Target Values: Comment=Standard Aufbewahrungsfrist für Exchange Online 93 Tage; Credential=***; Enabled=False; Ensure=Present; ExchangeLocation=(All); Name=Exchange Online Standard Retention Policy; RestrictiveRetention=False;
Verbose=True
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372] Test-TargetResource returned False
VERBOSE: []: LCM:  [ BeendenTesten   ]  [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372]  in 13.1090 Sekunden.
VERBOSE: []: LCM:  [ StartenFestlegen]  [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372]
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372] Setting configuration of RetentionCompliancePolicy for Exchange Online Standard Retention Policy
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372] Getting configuration of RetentionCompliancePolicy for Exchange Online Standard Retention Policy
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372] RetentionCompliancePolicy Exchange Online Standard Retention Policy does not exist.
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372] Policy Exchange Online Standard Retention Policy is not a Teams Policy
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372] Creating new Retention Compliance Policy Exchange Online Standard Retention Policy
VERBOSE: []: LCM:  [ BeendenFestlegen]  [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372]  in 4.5540 Sekunden.
VERBOSE: []: LCM:  [ BeendenRessource]  [[SCRetentionCompliancePolicy]Container-106-5399e964-9fd2-4ae1-8bd4-9fdc8fcb7372]
VERBOSE: []: LCM:  [ StartenRessource]  [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c]
VERBOSE: []: LCM:  [ StartenTesten   ]  [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c]
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c] Testing configuration of RetentionCompliancePolicy for OneDrive Standard Retention Policy
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c] Getting configuration of RetentionCompliancePolicy for OneDrive Standard Retention Policy
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c] RetentionCompliancePolicy OneDrive Standard Retention Policy does not exist.
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c] Current Values: Comment=Standard Aufbewahrungsrichtlinie für Microsoft OneDrive; Credential=***; Enabled=True; Ensure=Absent; Name=OneDrive Standard Retention Policy; OneDriveLocation=(All); RestrictiveRetention=False;
SharePointLocation=(All); Verbose=True
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c] Target Values: Comment=Standard Aufbewahrungsrichtlinie für Microsoft OneDrive; Credential=***; Enabled=True; Ensure=Present; Name=OneDrive Standard Retention Policy; OneDriveLocation=(All); RestrictiveRetention=False;
SharePointLocation=(All); Verbose=True
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c] Test-TargetResource returned False
VERBOSE: []: LCM:  [ BeendenTesten   ]  [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c]  in 0.4690 Sekunden.
VERBOSE: []: LCM:  [ StartenFestlegen]  [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c]
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c] Setting configuration of RetentionCompliancePolicy for OneDrive Standard Retention Policy
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c] Getting configuration of RetentionCompliancePolicy for OneDrive Standard Retention Policy
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c] RetentionCompliancePolicy OneDrive Standard Retention Policy does not exist.
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c] Policy OneDrive Standard Retention Policy is not a Teams Policy
VERBOSE: []:                            [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c] Creating new Retention Compliance Policy OneDrive Standard Retention Policy
VERBOSE: []: LCM:  [ BeendenFestlegen]  [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c]  in 1.8750 Sekunden.
VERBOSE: []: LCM:  [ BeendenRessource]  [[SCRetentionCompliancePolicy]Container-108-57e05c73-7202-4c48-bdf6-d885b08eb55c]
VERBOSE: []: LCM:  [ StartenRessource]  [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e]
VERBOSE: []: LCM:  [ StartenTesten   ]  [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e]
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e] Testing configuration of RetentionComplianceRule for Exchange Online Standard Retention Rule
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e] Getting configuration of RetentionComplianceRule for Exchange Online Standard Retention Rule
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e] RetentionComplianceRule Exchange Online Standard Retention Rule does not exist.
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e] Target Values: Credential=***; Ensure=Present; ExpirationDateOption=ModificationAgeInDays; Name=Exchange Online Standard Retention Rule; Policy=Exchange Online Standard Retention Policy; RetentionComplianceAction=Keep;
RetentionDuration=93; RetentionDurationDisplayHint=Days; Verbose=True
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e] Test-TargetResource returned False
VERBOSE: []: LCM:  [ BeendenTesten   ]  [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e]  in 0.5000 Sekunden.
VERBOSE: []: LCM:  [ StartenFestlegen]  [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e]
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e] Setting configuration of RetentionComplianceRule for Exchange Online Standard Retention Rule
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e] Getting configuration of RetentionComplianceRule for Exchange Online Standard Retention Rule
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e] RetentionComplianceRule Exchange Online Standard Retention Rule does not exist.
VERBOSE: []: LCM:  [ BeendenFestlegen]  [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e]  in 2.8560 Sekunden.
VERBOSE: []: LCM:  [ BeendenRessource]  [[SCRetentionComplianceRule]Container-109-6bf97721-68e1-428e-9ea4-73b937ebe06e]
VERBOSE: []: LCM:  [ StartenRessource]  [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063]
VERBOSE: []: LCM:  [ StartenTesten   ]  [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063]
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063] Testing configuration of RetentionComplianceRule for OneDrive Standard Retention Rule
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063] Getting configuration of RetentionComplianceRule for OneDrive Standard Retention Rule
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063] RetentionComplianceRule OneDrive Standard Retention Rule does not exist.
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063] Target Values: Credential=***; Ensure=Present; ExpirationDateOption=ModificationAgeInDays; Name=OneDrive Standard Retention Rule; Policy=OneDrive Standard Retention Policy; RetentionComplianceAction=Keep; RetentionDuration=93;
RetentionDurationDisplayHint=Days; Verbose=True
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063] Test-TargetResource returned False
VERBOSE: []: LCM:  [ BeendenTesten   ]  [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063]  in 0.4840 Sekunden.
VERBOSE: []: LCM:  [ StartenFestlegen]  [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063]
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063] Setting configuration of RetentionComplianceRule for OneDrive Standard Retention Rule
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063] Getting configuration of RetentionComplianceRule for OneDrive Standard Retention Rule
VERBOSE: []:                            [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063] RetentionComplianceRule OneDrive Standard Retention Rule does not exist.
VERBOSE: []: LCM:  [ BeendenFestlegen]  [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063]  in 2.4380 Sekunden.
VERBOSE: []: LCM:  [ BeendenRessource]  [[SCRetentionComplianceRule]Container-111-aa179bc3-ae48-45bd-a420-dbda7db63063]
VERBOSE: []:                            [] Die Konsistenzprüfung ist abgeschlossen.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 27.92 seconds
andikrueger commented 2 years ago

Could you run a test with the latest version of M365DSC and check if this is still an issue?

Please update your dependencies and uninstall any outdated dependencies and versions of m365dsc.

NikCharlebois commented 2 years ago

@atdheekurteshi have you had a chance to retest?

andikrueger commented 2 years ago

Closing due to inactivity.