Skip to content

Commit

Permalink
Merge pull request #1294 from microsoft/Dev
Browse files Browse the repository at this point in the history
Release 1.21.707.1
  • Loading branch information
NikCharlebois authored Jul 7, 2021
2 parents aa7287b + e916029 commit 5cde552
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 48 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Change log for Microsoft365DSC

# 1.21.707.1

* EXODkimSigningConfig
* Change the logic to remove an entry to disable it instead since the
cmdlet didn't exist to remove it.
ISSUE #1253
* EXOHostedContentFilterPolicy
* Fixed the value type for the senders addresses, regions and domains;
ISSUE #1165
* EXOOutboundConnector
* Fixed the creation logic to include ValidationRecipients;
ISSUE #1165
* EXOSharedMailbox
* Improved speed of extraction and removed warning about maximum 1,000
items retrieved;
* DEPENDENCIES
* Updated Microsoft.PowerApps.Administration.PowerShell to 2.0.127;
* MISC
* Delta Report - Fixes to compare null arrays properly and report as
a discrepancy.
ISSUES #1178 & #1249

# 1.21.630.1

* O365User
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ function Set-TargetResource

if (('Absent' -eq $Ensure ) -and ($DkimSigningConfig))
{
Write-Verbose -Message "Removing DkimSigningConfig $($Identity) "
Remove-DkimSigningConfig -Identity $Identity -Confirm:$false
Write-Verbose -Message "Disabling DkimSigningConfig $($Identity) "
Set-DkimSigningConfig -Identity $Identity -Enabled $false -Confirm:$false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,17 @@ function Get-TargetResource
}
else
{
$AllowedSendersValues = $HostedContentFilterPolicy.AllowedSenders.Sender | Select-Object Address -ExpandProperty Address
$BlockedSendersValues = $HostedContentFilterPolicy.BlockedSenders.Sender | Select-Object Address -ExpandProperty Address
$result = @{
Ensure = 'Present'
Identity = $Identity
AddXHeaderValue = $HostedContentFilterPolicy.AddXHeaderValue
AdminDisplayName = $HostedContentFilterPolicy.AdminDisplayName
AllowedSenderDomains = $HostedContentFilterPolicy.AllowedSenderDomains
AllowedSenders = $HostedContentFilterPolicy.AllowedSenders
BlockedSenderDomains = $HostedContentFilterPolicy.BlockedSenderDomains
BlockedSenders = $HostedContentFilterPolicy.BlockedSenders
AllowedSenderDomains = $HostedContentFilterPolicy.AllowedSenderDomains.Domain
AllowedSenders = $AllowedSendersValues
BlockedSenderDomains = $HostedContentFilterPolicy.BlockedSenderDomains.Domain
BlockedSenders = $BlockedSendersValues
BulkSpamAction = $HostedContentFilterPolicy.BulkSpamAction
BulkThreshold = $HostedContentFilterPolicy.BulkThreshold
DownloadLink = $HostedContentFilterPolicy.DownloadLink
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function Set-TargetResource
[System.String]
$Name,

[Parameter()]
[Parameter(Mandatory = $true)]
[System.String]
$Parent,

Expand Down Expand Up @@ -238,7 +238,7 @@ function Test-TargetResource
[System.String]
$Name,

[Parameter()]
[Parameter(Mandatory = $true)]
[System.String]
$Parent,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,14 @@ function Set-TargetResource
$SetValues.Remove('CertificateThumbprint') | Out-Null
$SetValues.Remove('CertificatePath') | Out-Null
$SetValues.Remove('CertificatePassword') | Out-Null

$isAutoExpandingArchiveEnabled = Get-OrganizationConfig | Select-Object -Property AutoExpandingArchiveEnabled

if ($isAutoExpandingArchiveEnabled -eq $True)
{
$SetValues.Remove('AutoExpandingArchive') | Out-Null
}

Set-OrganizationConfig @SetValues
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ function Get-TargetResource
$TestMode,

[Parameter()]
[System.String[]]
$TlsDomain = @(),
[System.String]
$TlsDomain,

[Parameter()]
[ValidateSet('EncryptionOnly', 'CertificateValidation', 'DomainValidation')]
Expand Down Expand Up @@ -260,8 +260,8 @@ function Set-TargetResource
$TestMode,

[Parameter()]
[System.String[]]
$TlsDomain = @(),
[System.String]
$TlsDomain,

[Parameter()]
[ValidateSet('EncryptionOnly', 'CertificateValidation', 'DomainValidation')]
Expand Down Expand Up @@ -339,6 +339,12 @@ function Set-TargetResource
$OutBoundConnectorParams.Remove('Identity') | Out-Null
$OutBoundConnectorParams.Remove("ValidationRecipients") | Out-Null
New-OutBoundConnector @OutBoundConnectorParams

if ($null -ne $ValidationRecipients)
{
Write-Verbose -Message "Updating ValidationRecipients"
Set-OutboundConnector -Identity $Identity -ValidationRecipients $ValidationRecipients -Confirm:$false
}
}
elseif (('Present' -eq $Ensure ) -and ($Null -ne $OutBoundConnector))
{
Expand Down Expand Up @@ -409,8 +415,8 @@ function Test-TargetResource
$TestMode,

[Parameter()]
[System.String[]]
$TlsDomain = @(),
[System.String]
$TlsDomain,

[Parameter()]
[ValidateSet('EncryptionOnly', 'CertificateValidation', 'DomainValidation')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MSFT_EXOOutboundConnector : OMI_BaseResource
[Write, Description("The ConnectorType parameter specifies a category for the domains that are serviced by the connector. Valid values are Partner and OnPremises"),ValueMap{"Partner","OnPremises"},Values{"Partner","OnPremises"}] String ConnectorType;
[Write, Description("The RecipientDomains parameter specifies the domain that the Outbound connector routes mail to. You can specify multiple domains separated by commas.")] String RecipientDomains[];
[Write, Description("The SmartHosts parameter specifies the smart hosts the Outbound connector uses to route mail. This parameter is required if you set the UseMxRecord parameter to $false and must be specified on the same command line.")] String SmartHosts[];
[Write, Description("The TlsDomain parameter specifies the domain name that the Outbound connector uses to verify the FQDN of the target certificate when establishing a TLS secured connection. This parameter is only used if the TlsSettings parameter is set to DomainValidation. Valid input for the TlsDomain parameter is an SMTP domain. You can use a wildcard character to specify all subdomains of a specified domain, as shown in the following example: *.contoso.com. However, you can't embed a wildcard character, as shown in the following example: domain.*.contoso.com")] String TlsDomain[];
[Write, Description("The TlsDomain parameter specifies the domain name that the Outbound connector uses to verify the FQDN of the target certificate when establishing a TLS secured connection. This parameter is only used if the TlsSettings parameter is set to DomainValidation. Valid input for the TlsDomain parameter is an SMTP domain. You can use a wildcard character to specify all subdomains of a specified domain, as shown in the following example: *.contoso.com. However, you can't embed a wildcard character, as shown in the following example: domain.*.contoso.com")] String TlsDomain;
[Write, Description("The TlsSettings parameter specifies the TLS authentication level that's used for outbound TLS connections established by this Outbound connector. Valid values are:EncryptionOnly | CertificateValidation | DomainValidation"), ValueMap{"EncryptionOnly","CertificateValidation","DomainValidation"}, Values{"EncryptionOnly","CertificateValidation","DomainValidation"}] String TlsSettings;
[Write, Description("The IsTransportRuleScoped parameter specifies whether the Outbound connector is associated with a transport rule (also known as a mail flow rule). Valid values are: $true | $false")] Boolean IsTransportRuleScoped;
[Write, Description("The RouteAllMessagesViaOnPremises parameter specifies that all messages serviced by this connector are first routed through the on-premises messaging system (Centralized mailrouting). Valid values are: $true | $false")] Boolean RouteAllMessagesViaOnPremises;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@ function Get-TargetResource

try
{
$mailboxes = Get-Mailbox -ErrorAction Stop
$mailbox = $mailboxes | Where-Object -FilterScript {
$_.RecipientTypeDetails -eq "SharedMailbox" -and `
$_.Identity -eq $DisplayName
}
$mailbox = Get-Mailbox -Identity $DisplayName `
-RecipientTypeDetails "SharedMailbox" `
-ResultSize Unlimited `
-ErrorAction Stop

if ($null -eq $mailbox)
{
Expand Down
30 changes: 22 additions & 8 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: 2021-06-30
# Generated on: 2021-07-07

@{

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

# Version number of this module.
ModuleVersion = '1.21.630.1'
ModuleVersion = '1.21.707.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -85,7 +85,7 @@
},
@{
ModuleName = "Microsoft.PowerApps.Administration.PowerShell"
RequiredVersion = "2.0.126"
RequiredVersion = "2.0.127"
},
@{
ModuleName = "MicrosoftTeams"
Expand Down Expand Up @@ -177,11 +177,25 @@
IconUri = 'https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Dependencies/Images/Logo.png?raw=true'

# ReleaseNotes of this module
ReleaseNotes = "* O365User
* Fix where export was throwing an error about an empty DSCBlock
ISSUE #1275;
* SPOTenantSettings
* Added support for specifying MarkNewFilesSensitiveByDefault"
ReleaseNotes = "* EXODkimSigningConfig
* Change the logic to remove an entry to disable it instead since the
cmdlet didn't exist to remove it.
ISSUE #1253
* EXOHostedContentFilterPolicy
* Fixed the value type for the senders addresses, regions and domains;
ISSUE #1165
* EXOOutboundConnector
* Fixed the creation logic to include ValidationRecipients;
ISSUE #1165
* EXOSharedMailbox
* Improved speed of extraction and removed warning about maximum 1,000
items retrieved;
* DEPENDENCIES
* Updated Microsoft.PowerApps.Administration.PowerShell to 2.0.127;
* MISC
* Delta Report - Fixes to compare null arrays properly and report as
a discrepancy.
ISSUES #1178 & #1249"

# Flag to indicate whether the module requires explicit user acceptance for install/update
# RequireLicenseAcceptance = $false
Expand Down
18 changes: 9 additions & 9 deletions Modules/Microsoft365DSC/Modules/M365DSCLogEngine.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function Export-M365DSCDiagnosticData
$null = New-Item -Path $tempPath -ItemType 'Directory'

# Copy DSC Verbose Logs
Write-Host ' * Copying DSC Verbose Logs' -ForegroundColor Grey
Write-Host ' * Copying DSC Verbose Logs' -ForegroundColor Gray
$logPath = Join-Path -Path $tempPath -ChildPath 'DSCLogs'
$null = New-Item -Path $logPath -ItemType 'Directory'

Expand All @@ -191,7 +191,7 @@ function Export-M365DSCDiagnosticData

if ($Anonymize)
{
Write-Host ' * Anonymizing DSC Verbose Logs' -ForegroundColor Grey
Write-Host ' * Anonymizing DSC Verbose Logs' -ForegroundColor Gray
foreach ($file in (Get-ChildItem -Path $logPath))
{
$content = Get-Content -Path $file.FullName -Raw -Encoding Unicode
Expand All @@ -201,12 +201,12 @@ function Export-M365DSCDiagnosticData
}

# Export M365Dsc event log
Write-Host ' * Exporting DSC Event Log' -ForegroundColor Grey
Write-Host ' * Exporting DSC Event Log' -ForegroundColor Gray
$evtExportLog = Join-Path -Path $tempPath -ChildPath 'M365Dsc.csv'

try
{
Write-Host ' * Anonymizing DSC Event Log' -ForegroundColor Grey
Write-Host ' * Anonymizing DSC Event Log' -ForegroundColor Gray
Get-EventLog -LogName 'M365Dsc' -After $afterDate | Export-Csv $evtExportLog -NoTypeInformation
if ($Anonymize)
{
Expand All @@ -228,12 +228,12 @@ function Export-M365DSCDiagnosticData
}

# PowerShell Version
Write-Host ' * Exporting PowerShell Version info' -ForegroundColor Grey
Write-Host ' * Exporting PowerShell Version info' -ForegroundColor Gray
$psInfoFile = Join-Path -Path $tempPath -ChildPath 'PSInfo.txt'
$PSVersionTable | Out-File -FilePath $psInfoFile

# OS Version
Write-Host ' * Exporting OS Version info' -ForegroundColor Grey
Write-Host ' * Exporting OS Version info' -ForegroundColor Gray
$computerInfoFile = Join-Path -Path $tempPath -ChildPath 'OSInfo.txt'

Get-ComputerInfo -Property @(
Expand All @@ -246,16 +246,16 @@ function Export-M365DSCDiagnosticData
'OsMuiLanguages') | Out-File -FilePath $computerInfoFile

# LCM settings
Write-Host ' * Exporting LCM Configuration info' -ForegroundColor Grey
Write-Host ' * Exporting LCM Configuration info' -ForegroundColor Gray
$lcmInfoFile = Join-Path -Path $tempPath -ChildPath 'LCMInfo.txt'
Get-DscLocalConfigurationManager | Out-File -FilePath $lcmInfoFile

# Creating export package
Write-Host ' * Creating Zip file with all collected information' -ForegroundColor Grey
Write-Host ' * Creating Zip file with all collected information' -ForegroundColor Gray
Compress-Archive -Path $tempPath -DestinationPath $ExportFilePath -Force

# Cleaning up temporary data
Write-Host ' * Removing temporary data' -ForegroundColor Grey
Write-Host ' * Removing temporary data' -ForegroundColor Gray
Remove-Item $tempPath -Recurse -Force -Confirm:$false

Write-Host ('Completed with export. Information exported to {0}' -f $ExportFilePath) -ForegroundColor Yellow
Expand Down
4 changes: 1 addition & 3 deletions Modules/Microsoft365DSC/Modules/M365DSCReport.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,7 @@ function Compare-M365DSCConfigurations
foreach ($propertyName in $sourceResource.Keys)
{
# Needs to be a separate nested if statement otherwise the ReferenceObject an be null and it will error out;
if((-not [System.String]::IsNullOrEmpty($sourceResource.$propertyName) -and `
-not [System.String]::IsNullOrEmpty($destinationResource.$propertyName)) -and `
$null -ne (Compare-Object -ReferenceObject ($sourceResource.$propertyName)`
if($null -ne (Compare-Object -ReferenceObject ($sourceResource.$propertyName)`
-DifferenceObject ($destinationResource.$propertyName)))
{
if ($null -eq $drift)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,26 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
EndUserSpamNotificationCustomSubject = 'This is SPAM'
EndUserSpamNotificationLanguage = 'Default'
BulkThreshold = 5
AllowedSenders = @('test@contoso.com', 'test@fabrikam.com')
AllowedSenderDomains = @('contoso.com', 'fabrikam.com')
BlockedSenders = @('me@privacy.net', 'thedude@contoso.com')
BlockedSenderDomains = @('privacy.net', 'facebook.com')
AllowedSenders = @{
Sender = @(
[PSCustomObject]@{Address = 'test@contoso.com'},
[PSCustomObject]@{Address = 'test@fabrikam.com'}
)
}
AllowedSenderDomains = @(
[PSCustomObject]@{Domain = 'contoso.com'},
[PSCustomObject]@{Domain = 'fabrikam.com'}
)
BlockedSenders = @{
Sender = @(
[PSCustomObject]@{Address = 'me@privacy.net'},
[PSCustomObject]@{Address = 'thedude@contoso.com'}
)
}
BlockedSenderDomains = @(
[PSCustomObject]@{Domain = 'privacy.net'},
[PSCustomObject]@{Domain = 'facebook.com'}
)
PhishZapEnabled = $true
SpamZapEnabled = $true
InlineSafetyTipsEnabled = $true
Expand Down Expand Up @@ -341,10 +357,26 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
EndUserSpamNotificationCustomSubject = 'This is SPAM'
EndUserSpamNotificationLanguage = 'Default'
BulkThreshold = 5
AllowedSenders = @('test@contoso.com')
AllowedSenderDomains = @('contoso.com')
BlockedSenders = @('me@privacy.net')
BlockedSenderDomains = @('facebook.com')
AllowedSenders = @{
Sender = @(
[PSCustomObject]@{Address = 'test@contoso.com'},
[PSCustomObject]@{Address = 'test@fabrikam.com'}
)
}
AllowedSenderDomains = @(
[PSCustomObject]@{Domain = 'contoso.com'},
[PSCustomObject]@{Domain = 'fabrikam.com'}
)
BlockedSenders = @{
Sender = @(
[PSCustomObject]@{Address = 'me@privacy.net'},
[PSCustomObject]@{Address = 'thedude@contoso.com'}
)
}
BlockedSenderDomains = @(
[PSCustomObject]@{Domain = 'privacy.net'},
[PSCustomObject]@{Domain = 'facebook.com'}
)
PhishZapEnabled = $true
SpamZapEnabled = $true
InlineSafetyTipsEnabled = $true
Expand Down

0 comments on commit 5cde552

Please sign in to comment.