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 TeamsChatLocation not enabled in the Tenant after creating Microsoft Teams Chat Standard Retention Policy/Rule via DSC #2338

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

Comments

@atdheekurteshi
Copy link

atdheekurteshi commented Sep 27, 2022

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

SCRetentionCompliancePolicy -Name 'Microsoft Teams Chat Standard Retention Policy' can be created with the following PS Code but the settings weren't applied correctly on the tenant:

PS C:\Windows\system32> Publish-DscConfiguration -Path C:\Users\src\MOFs\MainConfig -Force -Verbose
PS C:\Windows\system32> Start-DscConfiguration -UseExisting -Force -Verbose -Wait  

SCRetentionCompliancePolicy -Name 'Microsoft Teams Chat Standard Retention Policy' can be crated with -TeamsChatLocation 'All' attribute but it was not enabled on the Tenant via Microsoft365DSC.

In PowerShell when I run the following commands everything seems to be working fine for SCRetentionCompliancePolicy and i can see the changes in the Tenant and TeamsChatLocation its enabled:

PS C:\Windows\system32> New-RetentionCompliancePolicy -Name 'Microsoft Teams Chat Standard Retention Policy' -Comment 'abc' -Enabled:$false -RestrictiveRetention:$false -TeamsChatLocation 'All'

Name Workload                                                                    Enabled Mode
---- --------                                                                    ------- ----
Microsoft Teams Chat Standard Retention Policy Exchange, SharePoint, OneDriveForBusiness, Skype, ModernGroup, DynamicScope False   Enforce

PS C:\Windows\system32>

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

MOF file extract:

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

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

instance of MSFT_SCRetentionCompliancePolicy as $MSFT_SCRetentionCompliancePolicy2ref
{
ResourceID = "[SCRetentionCompliancePolicy]Container-107-7a9fb40b-94a8-42c4-96ae-08fcb8304d34";
 TeamsChatLocation = {
    "All"
};
 Enabled = False;
 Credential = $MSFT_Credential2ref;
 Ensure = "Present";
 Comment = "Standard Aufbewahrungsrichtlinie für Microsoft Teams Chat Protokolle";
 SourceInfo = "::20::3::SCRetentionCompliancePolicy";
 Name = "Microsoft Teams Chat Standard Retention Policy";
 ModuleName = "Microsoft365DSC";
 RestrictiveRetention = False;
 ModuleVersion = "1.22.921.1";

 ConfigurationName = "MainConfig";

};

instance of MSFT_SCRetentionComplianceRule as $MSFT_SCRetentionComplianceRule2ref
{
ResourceID = "[SCRetentionComplianceRule]Container-110-f9a02134-4c19-4b97-8009-e8baaec2a7ab";
 ExpirationDateOption = "CreationAgeInDays";
 RetentionDurationDisplayHint = "Days";
 Ensure = "Present";
 RetentionDuration = "730";
 Policy = "Microsoft Teams Chat Standard Retention Policy";
 SourceInfo = "::52::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 OMI_ConfigurationDocument


                    {
 Version="2.0.0";
 

                        MinimumCompatibleVersion = "1.0.0";
 

                        CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationName"};
 

                        Author="";
 

                        GenerationDate=
 

                        GenerationHost="";


                        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 performing wrong when creating Microsoft Teams Chat Standard Retention Policy/Rule via DSC SCRetentionCompliancePolicy TeamsChatLocation not enabled after creating Microsoft Teams Chat Standard Retention Policy/Rule via DSC Sep 27, 2022
@atdheekurteshi atdheekurteshi changed the title SCRetentionCompliancePolicy TeamsChatLocation not enabled after creating Microsoft Teams Chat Standard Retention Policy/Rule via DSC SCRetentionCompliancePolicy TeamsChatLocation not enabled in the Tenant after creating Microsoft Teams Chat Standard Retention Policy/Rule via DSC Sep 27, 2022
@NikCharlebois
Copy link
Collaborator

Issue identified. The Get-RetentionCompliancePolicy requires the -DistributionDetail switch to be included in order for the location parameters to be properly returned. Updating the Get-TargetResource to include this switch.

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
3 participants