Skip to content

Commit

Permalink
Merge pull request #4280 from NikCharlebois/Integration
Browse files Browse the repository at this point in the history
Release 1.24.131.1
  • Loading branch information
NikCharlebois authored Feb 2, 2024
2 parents f39fe95 + 5b40337 commit aec4b70
Show file tree
Hide file tree
Showing 16 changed files with 173 additions and 214 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change log for Microsoft365DSC

# UNRELEASED
# 1.24.131.1

* EXOAvailabilityAddressSpace
* Added support for the TargetServiceEpr and TargetTenantId parameters.
Expand All @@ -27,6 +27,9 @@
* Added support for ManagedIdentity Authentication across Teams resources.
* DEPENDENCIES
* Updated MSCloudLoginAssistant dependencies to version 1.1.10.
* MISC
* Change the way to Export encoding is done so that it no longer relies
on the Get-DSCResource function.

# 1.24.124.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,11 @@ function Get-TargetResource
try
{
Write-Verbose -Message 'Getting all Accepted Domain'
$AllAcceptedDomains = Get-AcceptedDomain -ErrorAction Stop

Write-Verbose -Message 'Filtering Accepted Domain list by Identity'
$AcceptedDomain = $AllAcceptedDomains | Where-Object -FilterScript { $_.Identity -eq $Identity }
$AcceptedDomain = Get-AcceptedDomain -Identity $Identity -ErrorAction SilentlyContinue

if ($null -eq $AcceptedDomain)
{
Write-Verbose -Message "AcceptedDomain configuration for $($Identity) does not exist."
Write-Verbose -Message "AcceptedDomain configuration for {$($Identity)} does not exist."
return $nullReturn
}
else
Expand Down Expand Up @@ -151,12 +148,10 @@ function Set-TargetResource
$Ensure = 'Present',

[Parameter()]
[ValidateScript( { $false -eq $_ })]
[System.Boolean]
$MatchSubDomains = $false,

[Parameter()]
[ValidateScript( { $false -eq $_ })]
[System.Boolean]
$OutboundOnly = $false,

Expand Down Expand Up @@ -223,7 +218,7 @@ function Set-TargetResource
OutboundOnly = $OutboundOnly
}

Write-Verbose -Message "Setting AcceptedDomain for $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $AcceptedDomainParams)"
Write-Verbose -Message "Setting AcceptedDomain for {$($Identity)} with values: $(Convert-M365DscHashtableToString -Hashtable $AcceptedDomainParams)"
Set-AcceptedDomain @AcceptedDomainParams
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,19 @@ function Set-TargetResource
ConditionalCustomAttribute9 = $ConditionalCustomAttribute9
ConditionalDepartment = $ConditionalDepartment
ConditionalStateOrProvince = $ConditionalStateOrProvince
DisplayName = $DisplayName
IncludedRecipients = $IncludedRecipients
RecipientFilter = $RecipientFilter
Confirm = $false
}

if (-not [System.String]::IsNullOrEmpty($DisplayName))
{
$SetAddressListParams.Add('DisplayName', $DisplayName)
}

if (-not [System.String]::IsNullOrEmpty($RecipientFilter))
{
$SetAddressListParams.Add('RecipientFilter', $RecipientFilter)
}
}
Write-Verbose -Message "Setting Address List '$($Name)' with values: $(Convert-M365DscHashtableToString -Hashtable $SetAddressListParams)"
Set-AddressList @SetAddressListParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,8 @@ function Set-TargetResource
$ConnectionMode = New-M365DSCConnection -Workload 'ExchangeOnline' `
-InboundParameters $PSBoundParameters

try
{
$AvailabilityAddressSpaces = Get-AvailabilityAddressSpace -ea stop
}
catch
{
New-M365DSCLogEntry -Message "Couldn't get AvailabilityAddressSpaces" `
-Exception $_ `
-Source $MyInvocation.MyCommand.ModuleName
}
$currentInstance = Get-TargetResource @PSBoundParameters

$AvailabilityAddressSpace = $AvailabilityAddressSpaces | Where-Object -FilterScript { $_.Identity -eq $Identity }
$AvailabilityAddressSpaceParams = [System.Collections.Hashtable]($PSBoundParameters)
$AvailabilityAddressSpaceParams.Remove('Ensure') | Out-Null
$AvailabilityAddressSpaceParams.Remove('Credential') | Out-Null
Expand All @@ -265,7 +255,7 @@ function Set-TargetResource
$AvailabilityAddressSpaceParams.Remove('CertificatePassword') | Out-Null
$AvailabilityAddressSpaceParams.Remove('ManagedIdentity') | Out-Null

if (('Present' -eq $Ensure ) -and ($null -eq $AvailabilityAddressSpace))
if ('Present' -eq $Ensure -and $currentInstance.Ensure -eq 'Absent')
{
Write-Verbose -Message "Creating AvailabilityAddressSpace $($Identity)."
# AvailabilityAddressSpace doe not have a new-AvailabilityAddressSpace cmdlet but instead uses an add-AvailabilityAddressSpace cmdlet
Expand All @@ -282,7 +272,7 @@ function Set-TargetResource
-Source $MyInvocation.MyCommand.ModuleName
}
}
elseif (('Present' -eq $Ensure ) -and ($Null -ne $AvailabilityAddressSpace))
elseif ('Present' -eq $Ensure -and $currentInstance.Ensure -eq 'Present')
{
Write-Verbose -Message "Setting AvailabilityAddressSpace $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $AvailabilityAddressSpaceParams)"
# AvailabilityAddressSpace is a special case in that it does not have a "set-AvailabilityAddressSpace" cmdlet. To change values of an existing AvailabilityAddressSpace it must be removed and then added again with add-AvailabilityAddressSpace
Expand All @@ -301,7 +291,7 @@ function Set-TargetResource
{
$AvailabilityAddressSpaceParams.Remove('Identity') | Out-Null
$AvailabilityAddressSpaceParams.Remove('Credentials') | Out-Null
add-AvailabilityAddressSpace @AvailabilityAddressSpaceParams -ea stop
Add-AvailabilityAddressSpace @AvailabilityAddressSpaceParams -ea stop
}
catch
{
Expand All @@ -310,7 +300,7 @@ function Set-TargetResource
-Source $MyInvocation.MyCommand.ModuleName
}
}
elseif (('Absent' -eq $Ensure ) -and ($null -ne $AvailabilityAddressSpace))
elseif ('Absent' -eq $Ensure -and $currentInstance.Ensure -eq 'Present')
{
Write-Verbose -Message "Removing AvailabilityAddressSpace $($Identity)"
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,13 @@ function Set-TargetResource
ConditionalCustomAttribute9 = $ConditionalCustomAttribute9
ConditionalDepartment = $ConditionalDepartment
ConditionalStateOrProvince = $ConditionalStateOrProvince
IncludedRecipients = $IncludedRecipients
Confirm = $false
}

if (-not [System.String]::IsNullOrEmpty($IncludedRecipients))
{
$NewGlobalAddressListParams.Add('IncludedRecipients', $IncludedRecipients)
}
}

$SetGlobalAddressListParams = @{
Expand All @@ -437,11 +441,19 @@ function Set-TargetResource
ConditionalCustomAttribute9 = $ConditionalCustomAttribute9
ConditionalDepartment = $ConditionalDepartment
ConditionalStateOrProvince = $ConditionalStateOrProvince
IncludedRecipients = $IncludedRecipients
RecipientFilter = $RecipientFilter
Confirm = $false
}

if (-not [System.String]::IsNullOrEmpty($IncludedRecipients))
{
$SetGlobalAddressListParams.Add('IncludedRecipients', $IncludedRecipients)
}

if (-not [System.String]::IsNullOrEmpty($RecipientFilter))
{
$SetGlobalAddressListParams.Add('RecipientFilter', $RecipientFilter)
}

# CASE: Global Address List doesn't exist but should;
if ($Ensure -eq 'Present' -and $currentGlobalAddressListConfig.Ensure -eq 'Absent')
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Configuration Example

Import-DscResource -ModuleName Microsoft365DSC

$Domain = $Credscredential.Username.Split('@')[1]
node localhost
{
EXOCASMailboxSettings 'AdeleVCasMailboxSettings'
Expand All @@ -22,10 +23,10 @@ Configuration Example
ActiveSyncBlockedDeviceIDs = @()
ActiveSyncDebugLogging = $False
ActiveSyncEnabled = $True
ActiveSyncMailboxPolicy = 'Demo EXO Mobile Device Policy Default'
ActiveSyncMailboxPolicy = 'Default'
ActiveSyncSuppressReadReceipt = $False
EwsEnabled = $True
Identity = 'AdeleV'
Identity = "admin@$Domain"
ImapEnabled = $True # Updated Property
ImapForceICalForCalendarRetrievalOption = $False
ImapMessagesRetrievalMimeFormat = 'BestBodyFormat'
Expand All @@ -36,7 +37,7 @@ Configuration Example
OutlookMobileEnabled = $True
OWAEnabled = $True
OWAforDevicesEnabled = $True
OwaMailboxPolicy = 'OwaMailboxPolicy-Default'
OwaMailboxPolicy = 'OwaMailboxPolicy-Integration'
PopEnabled = $False
PopForceICalForCalendarRetrievalOption = $True
PopMessagesRetrievalMimeFormat = 'BestBodyFormat'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Configuration Example
EnforceSchedulingHorizon = $True;
Ensure = "Present";
ForwardRequestsToDelegates = $True;
Identity = "AdeleV";
Identity = "admin@$Domain";
MaximumConflictInstances = 0;
MaximumDurationInMinutes = 1440;
MinimumDurationInMinutes = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Configuration Example
Name = "Integration Policy"
EnabledEmailAddressTemplates = @("SMTP:@$Domain")
EnabledPrimarySMTPAddressTemplate = "@$Domain"
ManagedByFilter = ""
Priority = 2 # Updated Property
ManagedByFilter = "Department -eq 'Sales'" # Updated Property
Priority = 1
Ensure = "Present"
Credential = $Credscredential
}
Expand Down
Loading

0 comments on commit aec4b70

Please sign in to comment.