Closed atdheekurteshi closed 2 years ago
This is somehow related to #2173.
It would appear that for some reason, even if certain parameters are returned via the Get- cmdlet and exposed via the New-* equivalent, that Teams based rules cannot use certain parameters, which is what is causing the issue: https://github.com/MicrosoftDocs/office-docs-powershell/issues/7026#issuecomment-759088407
My proposed strategy is to look up the parent policy to see if it has the TeamsPolicy property set to $true. If it does, then the ExpirationDateOption and RetentionComplianceAction properties will be ignored in the Set, and would not be returned in the Get.
Details of the scenario you tried and the problem that is occurring
SCRetentionCompliancePolicy -Name 'Microsoft Teams Chat Standard Retention Policy' can't be created with the following error:
SCRetentionCompliancePolicy -Name 'Microsoft Teams Chat Standard Retention Policy' can't be crated with -TeamsChatLocation 'All' attribute but in PowerShell is working check the code below.
Here we have two issues one is not creating the policy due to unknown and the second is the -TeamsChatLocation 'All' when specified you need to specify some other attributes like -TeamsChatLocationException, -TeamsChannelLocation,TeamsChannelLocationException when the value 'All' is provided.
In PowerShell when I run the following commands everything seems to be working fine for SCRetentionCompliancePolicy:
The DSC configuration that is used to reproduce the issue (as detailed as possible)
MOF file extract: