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

SCRetentionCompliancePolicy and SCRetentionComplianceRule not in desired state output false #2339

Closed
atdheekurteshi opened this issue Sep 27, 2022 · 0 comments · Fixed by #2376 or #2395
Labels

Comments

@atdheekurteshi
Copy link

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

SCRetentionCompliancePolicy / SCRetentionComplianceRule 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, SCRetentionComplianceRule:

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.921.1
PsDscRunAsCredential :
ResourceId           : [SCRetentionCompliancePolicy]Container-106-a739d58d-66cf-4229-a618-c8166559bcc0
SourceInfo           : ::18::3::SCRetentionCompliancePolicy
DurationInSeconds    : 15.758
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-106-a739d58d-66cf-4229-a618-c8166559bcc0
RebootRequested      : False
ResourceName         : SCRetentionCompliancePolicy
StartDate            : 9/27/2022 10:38:07 AM
StateChanged         : False
PSComputerName       : localhost

ConfigurationName    : MainConfig
DependsOn            :
ModuleName           : Microsoft365DSC
ModuleVersion        : 1.22.921.1
PsDscRunAsCredential :
ResourceId           : [SCRetentionCompliancePolicy]Container-107-693a7a31-a9d2-427f-99f9-0c1d01f1b14d
SourceInfo           : ::28::3::SCRetentionCompliancePolicy
DurationInSeconds    : 6.877
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-107-693a7a31-a9d2-427f-99f9-0c1d01f1b14d
RebootRequested      : False
ResourceName         : SCRetentionCompliancePolicy
StartDate            : 9/27/2022 10:38:23 AM
StateChanged         : False
PSComputerName       : localhost

ConfigurationName    : MainConfig
DependsOn            :
ModuleName           : Microsoft365DSC
ModuleVersion        : 1.22.921.1
PsDscRunAsCredential :
ResourceId           : [SCRetentionCompliancePolicy]Container-108-4e339b3a-30e7-475e-a67a-81f50377f555
SourceInfo           : ::38::3::SCRetentionCompliancePolicy
DurationInSeconds    : 1.348
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-108-4e339b3a-30e7-475e-a67a-81f50377f555
RebootRequested      : False
ResourceName         : SCRetentionCompliancePolicy
StartDate            : 9/27/2022 10:38:30 AM
StateChanged         : False
PSComputerName       : localhost

ConfigurationName    : MainConfig
DependsOn            :
ModuleName           : Microsoft365DSC
ModuleVersion        : 1.22.921.1
PsDscRunAsCredential :
ResourceId           : [SCRetentionComplianceRule]Container-109-fae998ab-dfb8-4d74-8456-ff52a942e02a
SourceInfo           : ::49::3::SCRetentionComplianceRule
DurationInSeconds    : 1.242
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-109-fae998ab-dfb8-4d74-8456-ff52a942e02a
RebootRequested      : False
ResourceName         : SCRetentionComplianceRule
StartDate            : 9/27/2022 10:38:31 AM
StateChanged         : False
PSComputerName       : localhost

ConfigurationName    : MainConfig
DependsOn            :
ModuleName           : Microsoft365DSC
ModuleVersion        : 1.22.921.1
PsDscRunAsCredential :
ResourceId           : [SCRetentionComplianceRule]Container-110-b8298354-0749-41ae-8da6-d4371308ddf1
SourceInfo           : ::60::3::SCRetentionComplianceRule
DurationInSeconds    : 1.232
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-110-b8298354-0749-41ae-8da6-d4371308ddf1
RebootRequested      : False
ResourceName         : SCRetentionComplianceRule
StartDate            : 9/27/2022 10:38:32 AM
StateChanged         : False
PSComputerName       : localhost

ConfigurationName    : MainConfig
DependsOn            :
ModuleName           : Microsoft365DSC
ModuleVersion        : 1.22.921.1
PsDscRunAsCredential :
ResourceId           : [SCRetentionComplianceRule]Container-111-623a4c95-c197-4b43-ad5f-465929133e9c
SourceInfo           : ::71::3::SCRetentionComplianceRule
DurationInSeconds    : 1.457
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-111-623a4c95-c197-4b43-ad5f-465929133e9c
RebootRequested      : False
ResourceName         : SCRetentionComplianceRule
StartDate            : 9/27/2022 10:38:33 AM
StateChanged         : False
PSComputerName       : localhost


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

ResourceId                                                                      SourceInfo
----------                                                                      ----------
[SCRetentionCompliancePolicy]Container-106-a739d58d-66cf-4229-a618-c8166559bcc0 ::18::3::SCRetentionCompliancePolicy
[SCRetentionCompliancePolicy]Container-107-693a7a31-a9d2-427f-99f9-0c1d01f1b14d ::28::3::SCRetentionCompliancePolicy
[SCRetentionCompliancePolicy]Container-108-4e339b3a-30e7-475e-a67a-81f50377f555 ::38::3::SCRetentionCompliancePolicy
[SCRetentionComplianceRule]Container-109-fae998ab-dfb8-4d74-8456-ff52a942e02a   ::49::3::SCRetentionComplianceRule
[SCRetentionComplianceRule]Container-110-b8298354-0749-41ae-8da6-d4371308ddf1   ::60::3::SCRetentionComplianceRule
[SCRetentionComplianceRule]Container-111-623a4c95-c197-4b43-ad5f-465929133e9c   ::71::3::SCRetentionComplianceRule

outputs the SCRetentionCompliancePolicy and SCRetentionComplianceRule 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.921.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.921.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.921.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.921.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.921.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.921.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.921.1
@atdheekurteshi atdheekurteshi changed the title SCRetentionCompliancePolicy and SCRetentionComplianceRule not in desired state output false but the settings where correctly applied/configured in a tenant SCRetentionCompliancePolicy and SCRetentionComplianceRule not in desired state output false Sep 27, 2022
NikCharlebois added a commit to NikCharlebois/Microsoft365DSC that referenced this issue Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants