Skip to content

Commit

Permalink
Merge pull request #2612 from microsoft/Dev
Browse files Browse the repository at this point in the history
Release 1.22.1130.1
  • Loading branch information
NikCharlebois authored Dec 1, 2022
2 parents d093ffe + 9133ac0 commit b57d818
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 111 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change log for Microsoft365DSC

# 1.22.1130.1

* SCRetentionCompliancePolicy
* Fixed an issue with the Update logic in the Set-TargetResource
FIXES [#2600](https://github.com/microsoft/Microsoft365DSC/issues/2600)

# 1.22.1123.1

* IntuneDeviceConfigurationPolicyWindows10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,34 +142,100 @@ function Get-TargetResource
Comment = $PolicyObject.Comment
Enabled = $PolicyObject.Enabled
RestrictiveRetention = $PolicyObject.RestrictiveRetention
TeamsChannelLocation = [array]$PolicyObject.TeamsChannelLocation.DisplayName
TeamsChannelLocationException = $PolicyObject.TeamsChannelLocationException
TeamsChatLocation = [array]$PolicyObject.TeamsChatLocation.DisplayName
TeamsChatLocationException = $PolicyObject.TeamsChatLocationException
TeamsChannelLocation = @()
TeamsChannelLocationException = @()
TeamsChatLocation = @()
TeamsChatLocationException = @()
Credential = $Credential
}

if ($PolicyObject.TeamsChannelLocation.Count -gt 0)
{
$result.TeamsChannelLocation = [array]$PolicyObject.TeamsChannelLocation.Name
}
if ($PolicyObject.TeamsChatLocation.Count -gt 0)
{
$result.TeamsChatLocation = [array]$PolicyObject.TeamsChatLocation.Name
}
if ($PolicyObject.TeamsChannelLocationException.Count -gt 0)
{
$result.TeamsChannelLocationException = [array]$PolicyObject.TeamsChannelLocationException.Name
}
if ($PolicyObject.TeamsChatLocationException.Count -gt 0)
{
$result.TeamsChatLocationException = $PolicyObject.TeamsChatLocationException.Name
}
}
else
{
$result = @{
Ensure = 'Present'
Name = $PolicyObject.Name
Comment = $PolicyObject.Comment
DynamicScopeLocation = [array]$PolicyObject.DynamicScopeLocation.DisplayName
DynamicScopeLocation = @()
Enabled = $PolicyObject.Enabled
ExchangeLocation = [array]$PolicyObject.ExchangeLocation.DisplayName
ExchangeLocationException = [array]$PolicyObject.ExchangeLocationException
ModernGroupLocation = [array]$PolicyObject.ModernGroupLocation.DisplayName
ModernGroupLocationException = [array]$PolicyObject.ModernGroupLocationException
OneDriveLocation = [array]$PolicyObject.OneDriveLocation.DisplayName
OneDriveLocationException = [array]$PolicyObject.OneDriveLocationException
PublicFolderLocation = [array]$PolicyObject.PublicFolderLocation.DisplayName
ExchangeLocation = @()
ExchangeLocationException = @()
ModernGroupLocation = @()
ModernGroupLocationException = @()
OneDriveLocation = @()
OneDriveLocationException = @()
PublicFolderLocation = @()
RestrictiveRetention = $PolicyObject.RestrictiveRetention
SharePointLocation = [array]$PolicyObject.SharePointLocation.DisplayName
SharePointLocationException = $PolicyObject.SharePointLocationException
SkypeLocation = [array]$PolicyObject.SkypeLocation.DisplayName
SkypeLocationException = $PolicyObject.SkypeLocationException
Credential = $Credential
SharePointLocation = @()
SharePointLocationException = @()
SkypeLocation = @()
SkypeLocationException = @()
Credential = $Credential
}

if ($PolicyObject.DynamicScopeLocation.Count -gt 0)
{
$result.DynamicScopeLocation = [array]$PolicyObject.DynamicScopeLocation.Name
}
if ($PolicyObject.ExchangeLocation.Count -gt 0)
{
$result.ExchangeLocation = [array]$PolicyObject.ExchangeLocation.Name
}
if ($PolicyObject.ModernGroupLocation.Count -gt 0)
{
$result.ModernGroupLocation = [array]$PolicyObject.ModernGroupLocation.Name
}
if ($PolicyObject.OneDriveLocation.Count -gt 0)
{
$result.OneDriveLocation = [array]$PolicyObject.OneDriveLocation.Name
}
if ($PolicyObject.PublicFolderLocation.Count -gt 0)
{
$result.PublicFolderLocation = [array]$PolicyObject.PublicFolderLocation.Name
}
if ($PolicyObject.SharePointLocation.Count -gt 0)
{
$result.SharePointLocation = [array]$PolicyObject.SharePointLocation.Name
}
if ($PolicyObject.SkypeLocation.Count -gt 0)
{
$result.SkypeLocation = [array]$PolicyObject.SkypeLocation.Name
}
if ($PolicyObject.ExchangeLocationException.Count -gt 0)
{
$result.ExchangeLocationException = [array]$PolicyObject.ExchangeLocationException.Name
}
if ($PolicyObject.ModernGroupLocationException.Count -gt 0)
{
$result.ModernGroupLocationException = [array]$PolicyObject.ModernGroupLocationException.Name
}
if ($PolicyObject.OneDriveLocationException.Count -gt 0)
{
$result.OneDriveLocationException = [array]$PolicyObject.OneDriveLocationException.Name
}
if ($PolicyObject.SharePointLocationException.Count -gt 0)
{
$result.SharePointLocationException = [array]$PolicyObject.SharePointLocationException.Name
}
if ($PolicyObject.SkypeLocationException.Count -gt 0)
{
$result.SkypeLocationException = [array]$PolicyObject.SkypeLocationException.Name
}
}

Expand Down Expand Up @@ -206,7 +272,6 @@ function Get-TargetResource

function Set-TargetResource
{

[CmdletBinding()]
param
(
Expand Down Expand Up @@ -331,9 +396,9 @@ function Set-TargetResource

$CurrentPolicy = Get-TargetResource @PSBoundParameters

$isTeamsBased = $false
if ($null -eq $TeamsChannelLocation -and $null -eq $TeamsChatLocation)
{
Write-Verbose -Message "Policy $Name is not a Teams Policy"
$CreationParams = $PSBoundParameters
$CreationParams.Remove("Credential")
$CreationParams.Remove("Ensure")
Expand Down Expand Up @@ -582,16 +647,30 @@ function Set-TargetResource
}
else
{
$isTeamsBased = $true
Write-Verbose -Message "Policy $Name is a Teams Policy"
$CreationParams = @{
Identity = $Name
Comment = $Comment
Enabled = $Enabled
RestrictiveRetention = $RestrictiveRetention
TeamsChannelLocation = $TeamsChannelLocation
TeamsChannelLocationException = $TeamsChannelLocationException
TeamsChatLocation = $TeamsChatLocation
TeamsChatLocationException = $TeamsChatLocationException
}

if ($null -ne $TeamsChannelLocation)
{
$CreationParams.Add('TeamsChannelLocation', $TeamsChannelLocation)
}
if ($null -ne $TeamsChannelLocationException)
{
$CreationParams.Add('TeamsChannelLocationException', $TeamsChannelLocationException)
}
if ($null -ne $TeamsChatLocation)
{
$CreationParams.Add('TeamsChatLocation', $TeamsChatLocation)
}
if ($null -ne $TeamsChatLocationException)
{
$CreationParams.Add('TeamsChatLocationException', $TeamsChatLocationException)
}

# Teams Chat Location is specified or already existing, we need to determine
Expand All @@ -614,8 +693,6 @@ function Set-TargetResource
Write-Verbose -Message "Adding the AddTeamsChatLocation property."
$CreationParams.Add("AddTeamsChatLocation", $ToBeAdded)
}
Write-Verbose -Message "Removing the TeamsChatLocation property."
$CreationParams.Remove("TeamsChatLocation")
}

# Teams Chat Location Exception is specified or already existing, we need to determine
Expand All @@ -638,8 +715,6 @@ function Set-TargetResource
Write-Verbose -Message "Adding the AddTeamsChatLocationException property."
$CreationParams.Add("AddTeamsChatLocationException", $ToBeAdded)
}
Write-Verbose -Message "Removing the TeamsChatLocationException property."
$CreationParams.Remove("TeamsChatLocationException")
}

# Teams Channel Location is specified or already existing, we need to determine
Expand All @@ -662,8 +737,6 @@ function Set-TargetResource
Write-Verbose -Message "Adding the AddTeamsChannelLocation property."
$CreationParams.Add("AddTeamsChannelLocation", $ToBeAdded)
}
Write-Verbose -Message "Removing the TeamsChannelLocation property."
$CreationParams.Remove("TeamsChannelLocation")
}

# Teams Channel Location Exception is specified or already existing, we need to determine
Expand All @@ -686,20 +759,28 @@ function Set-TargetResource
Write-Verbose -Message "Adding the AddTeamsChannelLocationException property."
$CreationParams.Add("AddTeamsChannelLocationException", $ToBeAdded)
}
Write-Verbose -Message "Removing the TeamsChannelLocationException property."
$CreationParams.Remove("TeamsChannelLocationException")
}
$CreationParams.Remove("RestrictiveRetention") | Out-Null
}
if (('Present' -eq $Ensure) -and ('Absent' -eq $CurrentPolicy.Ensure))
{
Write-Verbose -Message "Creating new Retention Compliance Policy $Name"
$CreationParams.Add("Name", $Name)
$CreationParams.Remove("Identity") | Out-Null
Write-Verbose -Message "Creating new Retention Compliance Policy $Name with values: $(Convert-M365DscHashtableToString -Hashtable $CreationParams)"
New-RetentionCompliancePolicy @CreationParams
}
elseif (('Present' -eq $Ensure) -and ('Present' -eq $CurrentPolicy.Ensure))
{
# Remove Teams specific parameters
$CreationParams.Remove("TeamsChatLocationException") | Out-Null
$CreationParams.Remove("TeamsChannelLocationException") | Out-Null
$CreationParams.Remove("TeamsChannelLocation") | Out-Null
$CreationParams.Remove("TeamsChatLocation") | Out-Null

if ($isTeamsBased)
{
$CreationParams.Remove("RestrictiveRetention") | Out-Null
}

Write-Verbose "Updating Policy with values: $(Convert-M365DscHashtableToString -Hashtable $CreationParams)"
Set-RetentionCompliancePolicy @CreationParams
}
Expand Down
50 changes: 5 additions & 45 deletions Modules/Microsoft365DSC/Microsoft365DSC.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 2022-11-23
# Generated on: 2022-11-30

@{

# Script module or binary module file associated with this manifest.
# RootModule = ''

# Version number of this module.
ModuleVersion = '1.22.1123.1'
ModuleVersion = '1.22.1130.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -139,49 +139,9 @@
IconUri = 'https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Dependencies/Images/Logo.png?raw=true'

# ReleaseNotes of this module
ReleaseNotes = "* IntuneDeviceConfigurationPolicyWindows10
* Fixed issue when creating this resource if property DefenderDetectedMalwareActions was not present, it'd still be created but with errors.
FIXES [#2581](https://github.com/microsoft/Microsoft365DSC/issues/2581)
* AADUser
* Fixed issue with license assignment
FIXES [#2556](https://github.com/microsoft/Microsoft365DSC/issues/2556)
* EXOOrganizationRelationship
* Add 'None' as supported value for MailboxMoveCapability
FIXES [#2570](https://github.com/microsoft/Microsoft365DSC/issues/2570)
* IntuneRoleDefinition
* Initial Release
* Manage Intune Role definition
* IntuneRoleAssignment
* Initial Release
* Manage Intune Role assignment
* O365AdminAuditLogConfig
* Updated settings.json to include permissions.
FIXES [#2517](https://github.com/microsoft/Microsoft365DSC/issues/2517)
* O365OrgCustomizationSetting
* Updated settings.json to include permissions.
FIXES [#2517](https://github.com/microsoft/Microsoft365DSC/issues/2517)
* SCDLPCompliancePolicy
* Fixes an issue where the Exchange Location and Exception where not sent back in a correct format during Export.
FIXES [#2545](https://github.com/microsoft/Microsoft365DSC/issues/2545)
* SCRetentionCompliancePolicy
* Fixes issue with the TeamsChannelLocation and TeamsChatsLocation parameters that were improperly returned by the Get- function.
FIXES [#2472](https://github.com/microsoft/Microsoft365DSC/issues/2472)
* SCRetentionComplianceRule
* Fixes issue with Teams Policy where the RetentionDurationDisplayHint and ExpirationDateOption parameters weren't returned by the Get- function.
FIXES [#2472](https://github.com/microsoft/Microsoft365DSC/issues/2472)
* TeamsFederationConfiguration
* Fixes an issue where the extraction of allowed domain and blocked domain wasn't in the proper format.
FIXES [#2576](https://github.com/microsoft/Microsoft365DSC/issues/2576)
* DEPENDENCIES
* Updated Microsoft.Graph.* to version 1.17.0;
* Updated MSCloudLoginAssistant to version 1.0.98;
* MISC
* Removed Test-M365DSCDependenciesForNewVersions from export functions. This will improve export speed.
* New Parameter ValidateOnly for Update-M365DSCDependencies to check if all dependencies are installed.
FIXES [2519](https://github.com/microsoft/Microsoft365DSC/issues/2519)
* Fixed incorrect usage of Write-Information cmdLet
* Fixed typos for permissions in settings.json
FIXES [2553](https://github.com/microsoft/Microsoft365DSC/issues/2553)"
ReleaseNotes = "* SCRetentionCompliancePolicy
* Fixed an issue with the Update logic in the Set-TargetResource
FIXES [#2600](https://github.com/microsoft/Microsoft365DSC/issues/2600)"

# Flag to indicate whether the module requires explicit user acceptance for install/update
# RequireLicenseAcceptance = $false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,32 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
return @{
Name = "TestPolicy"
ExchangeLocation = @{
DisplayName = "https://contoso.sharepoint.com/sites/demo"
Name = "https://contoso.sharepoint.com/sites/demo"
}
ExchangeLocationException = @{
Name = "https://contoso.sharepoint.com"
}
ExchangeLocationException = "https://contoso.sharepoint.com"
OneDriveLocation = @{
DisplayName = "https://contoso.sharepoint.com/sites/demo"
Name = "https://contoso.sharepoint.com/sites/demo"
}
OneDriveLocationException = @{
Name = "https://contoso.com"
}
OneDriveLocationException = "https://contoso.com"
PublicFolderLocation = @{
DisplayName = "\\contoso\PF"
Name = "\\contoso\PF"
}
SkypeLocation = @{
DisplayName = "https://contoso.sharepoint.com/sites/demo"
Name = "https://contoso.sharepoint.com/sites/demo"
}
SkypeLocationException = @{
Name = "https://contoso.sharepoint.com/"
}
SkypeLocationException = "https://contoso.sharepoint.com/"
SharePointLocation = @{
DisplayName = "https://contoso.sharepoint.com/sites/demo"
Name = "https://contoso.sharepoint.com/sites/demo"
}
SharePointLocationException = @{
Name = "https://contoso.com"
}
SharePointLocationException = "https://contoso.com"
}
}
}
Expand Down
Loading

0 comments on commit b57d818

Please sign in to comment.