Skip to content

Commit

Permalink
Merge pull request #1256 from microsoft/Dev
Browse files Browse the repository at this point in the history
Release 1.21.602.1
  • Loading branch information
NikCharlebois authored Jun 2, 2021
2 parents 5729b25 + a269b8e commit b3497a5
Show file tree
Hide file tree
Showing 33 changed files with 183 additions and 74 deletions.
23 changes: 20 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Change log for Microsoft365DSC
1.21.526.2

# 1.21.602.1

* AADMSGroups
* Fix for the export where the MailNickName was being prompted;
* EXOManagementRole
* BREAKING: Now requires the Parent property as Mandatory;
* TeamsChannel
* Fixed an issue where content was dedup and boolean
values were appended to the exported content;
* TeamsUpgradePolicy
* Improved performance retrieving users assigned to policy;
* MISC
* Fix for Teams authentication. Improvements on session
reuse.

# 1.21.526.2

* EXOSafeAttachmentRule
* Fixed issue #1213 Policy X already has rule Y associated with it
if rule exists already
Expand All @@ -14,7 +31,7 @@
* EXOTransportRule
* Fix #1230 Changed ExceptIfSenderInRecipientList to array

1.21.519.2
# 1.21.519.2

* AzureADRoleDefinition
* Fix an issue where deprecated roles were not increasing
Expand All @@ -30,7 +47,7 @@
* Forces a Global load of the new MicrosoftTeams module for
Teams resources;

1.21.519.1
#1.21.519.1

* TeamsClientConfiguration
* Fixed an issue where the RestrictedSenderList was not properly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ function Get-TargetResource
[System.String]
$DisplayName,

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

[Parameter()]
[System.String]
$Id,
Expand Down Expand Up @@ -41,10 +45,6 @@ function Get-TargetResource
[System.Boolean]
$IsAssignableToRole,

[Parameter()]
[System.String]
$MailNickname,

[Parameter()]
[ValidateSet('Public', 'Private', 'HiddenMembership')]
[System.String]
Expand Down Expand Up @@ -184,6 +184,10 @@ function Set-TargetResource
[System.String]
$DisplayName,

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

[Parameter()]
[System.String]
$Id,
Expand Down Expand Up @@ -217,10 +221,6 @@ function Set-TargetResource
[System.Boolean]
$IsAssignableToRole,

[Parameter()]
[System.String]
$MailNickname,

[Parameter()]
[ValidateSet('Public', 'Private', 'HiddenMembership')]
[System.String]
Expand Down Expand Up @@ -259,24 +259,28 @@ function Set-TargetResource
Add-M365DSCTelemetryEvent -Data $data
#endregion

$currentGroup = Get-TargetResource @PSBoundParameters
$currentParameters = $PSBoundParameters
$currentParameters.Remove("ApplicationId")
$currentParameters.Remove("TenantId")
$currentParameters.Remove("CertificateThumbprint")
$currentParameters.Remove("GlobalAdminAccount")
$currentParameters.Remove("Ensure")

if ($Ensure -eq 'Present' -and $GroupTypes.Contains("Unified") -and $MailEnabled -eq $false)
$currentGroup = Get-TargetResource @PSBoundParameters
$currentParameters.Remove("ApplicationId") | Out-Null
$currentParameters.Remove("TenantId") | Out-Null
$currentParameters.Remove("CertificateThumbprint") | Out-Null
$currentParameters.Remove("GlobalAdminAccount") | Out-Null
$currentParameters.Remove("Ensure") | Out-Null

if ($Ensure -eq 'Present' -and `
($null -ne $GroupTypes -and $GroupTypes.Contains("Unified")) -and `
($null -ne $MailEnabled -and $MailEnabled -eq $false))
{
Write-Verbose -Message "Cannot set mailenabled to false if GroupTypes is set to Unified when creating group."
throw "Cannot set mailenabled to false if GroupTypes is set to Unified when creating a group."
}

if ($Ensure -eq 'Present' -and $currentGroup.Ensure -eq 'Present')
{
Write-Verbose -Message "Group {$DisplayName} exists and it should."
try
{
Write-Verbose -Message "Updating settings by ID for group {$DisplayName}"
if ($true -eq $currentParameters.ContainsKey("IsAssignableToRole"))
{
Write-Verbose -Message "Cannot set IsAssignableToRole once group is created."
Expand All @@ -288,6 +292,7 @@ function Set-TargetResource
}
else
{
Write-Verbose -Message "Updating settings for group {$DisplayName}"
Set-AzureADMSGroup @currentParameters
}
}
Expand Down Expand Up @@ -333,6 +338,10 @@ function Test-TargetResource
[System.String]
$DisplayName,

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

[Parameter()]
[System.String]
$Id,
Expand Down Expand Up @@ -366,10 +375,6 @@ function Test-TargetResource
[System.Boolean]
$IsAssignableToRole,

[Parameter()]
[System.String]
$MailNickname,

[Parameter()]
[ValidateSet('Public', 'Private', 'HiddenMembership')]
[System.String]
Expand Down Expand Up @@ -473,6 +478,7 @@ function Export-TargetResource
$Params = @{
GlobalAdminAccount = $GlobalAdminAccount
DisplayName = $group.DisplayName
MailNickName = $group.MailNickName
Id = $group.Id
ApplicationId = $ApplicationId
TenantId = $TenantId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
class MSFT_AADMSGroup : OMI_BaseResource
{
[Key, Description("DisplayName of the AADMS Group")] String DisplayName;
[Key, Description("Specifies a mail nickname for the group.")] String MailNickname;
[Write, Description("Specifies a description for the group.")] String Description;
[Write, Description("Specifies an ID for the group.")] String Id;
[Write, Description("Specifies that the group is a dynamic group. To create a dynamic group, specify a value of DynamicMembership.")] String GroupTypes[];
Expand All @@ -10,7 +11,6 @@ class MSFT_AADMSGroup : OMI_BaseResource
[Write, Description("Specifies whether the group is security enabled. For security groups, this value must be $True.")] Boolean SecurityEnabled;
[Write, Description("Specifies whether this group is mail enabled. Currently, you cannot create mail enabled groups in Azure AD.")] Boolean MailEnabled;
[Write, Description("Specifies whether this group can be assigned a role. Only available when creating a group and can't be modified after group is created.")] Boolean IsAssignableToRole;
[Write, Description("Specifies a mail nickname for the group. If MailEnabled is $False you must still specify a mail nickname.")] String MailNickname;
[Write, Description("This parameter determines the visibility of the group's content and members list."), ValueMap{"Public","Private","HiddenMembership"}, Values{"Public","Private","HiddenMembership"}] String Visibility;
[Write, Description("Specify if the Azure AD Group should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Write, Description("Credentials of the Azure Active Directory Admin"), EmbeddedInstance("MSFT_Credential")] String GlobalAdminAccount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function Get-TargetResource
[System.String]
$Name,

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

Expand Down Expand Up @@ -357,7 +357,7 @@ function Export-TargetResource

try
{
[array]$AllManagementRoles = Get-ManagementRole -ErrorAction Stop
[array]$AllManagementRoles = Get-ManagementRole | Where-Object -FilterScript {$_.Parent -ne $null}

$dscContent = ""

Expand All @@ -382,6 +382,7 @@ function Export-TargetResource
CertificateThumbprint = $CertificateThumbprint
CertificatePassword = $CertificatePassword
CertificatePath = $CertificatePath
Parent = $ManagementRole.Parent
}
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
Expand All @@ -403,6 +404,7 @@ function Export-TargetResource
{
try
{
Write-Host $Global:M365DSCEmojiRedX
Write-Verbose -Message $_
$tenantIdValue = ""
if (-not [System.String]::IsNullOrEmpty($TenantId))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class MSFT_EXOManagementRole : OMI_BaseResource
{
[Key, Description("The Name parameter specifies the name of the role. The maximum length of the name is 64 characters.")] String Name;
[Write, Description("The Parent parameter specifies the identity of the role to copy.")] String Parent;
[Key, Description("The Parent parameter specifies the identity of the role to copy. Mandatory for management role creation/update or when Ensure=Present. Non-mandatory for Ensure=Absent")] String Parent;
[Write, Description("The Description parameter specifies the description that's displayed when the management role is viewed using the Get-ManagementRole cmdlet.")] String Description;
[Write, Description("Specify if the Management Role should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Write, Description("Credentials of the Exchange Global Admin"), EmbeddedInstance("MSFT_Credential")] string GlobalAdminAccount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2523,6 +2523,10 @@ function Export-TargetResource
[array]$AllTransportRules = Get-TransportRule
$dscContent = ""
$i = 1
if ($AllTransportRules.Length -eq 0)
{
Write-Host $Global:M365DSCEmojiGreenCheckMark
}
foreach ($TransportRule in $AllTransportRules)
{
Write-Host " |---[$i/$($AllTransportRules.Count)] $($TransportRule.Name)" -NoNewline
Expand Down Expand Up @@ -2555,6 +2559,7 @@ function Export-TargetResource
{
try
{
Write-Host $Global:M365DSCEmojiRedX
Write-Verbose -Message $_
$tenantIdValue = ""
if (-not [System.String]::IsNullOrEmpty($TenantId))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,14 @@ function Export-TargetResource
{
[array]$siteScripts = Get-PnPSiteScript -ErrorAction Stop

if ($siteScripts.Length -eq 0)
{
Write-Host $Global:M365DSCEmojiGreenCheckMark
}
else
{
Write-Host "`r`n" -NoNewline
}
foreach ($script in $siteScripts)
{
Write-Host " [$i/$($siteScripts.Length)] $($script.Title)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ function Export-TargetResource
}
catch
{
Write-Host $Global:M365DSCEmojiRedX
try
{
Write-Verbose -Message $_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,15 +383,15 @@ function Export-TargetResource
if ($ConnectionMode -eq 'Credential')
{
$result.GlobalAdminAccount = Resolve-Credentials -UserName "globaladmin"
$result.Remove("ApplicationId")
$result.Remove("TenantId")
$result.Remove("CertificateThumbprint")
$result.Remove("ApplicationId") | Out-Null
$result.Remove("TenantId") | Out-Null
$result.Remove("CertificateThumbprint") | Out-Null
}
else
{
$result.Remove("GlobalAdminAccount")
}
$currentDSCBlock += " TeamsChannel " + (New-Guid).ToString() + "`r`n"
$currentDSCBlock = " TeamsChannel " + (New-Guid).ToString() + "`r`n"
$currentDSCBlock += " {`r`n"
$content = Get-DSCBlock -Params $result -ModulePath $PSScriptRoot
if ($ConnectionMode -eq 'Credential')
Expand All @@ -411,6 +411,7 @@ function Export-TargetResource
}
catch
{
Write-Host $Global:M365DSCEmojiRedX
try
{
Write-Verbose -Message $_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ function Export-TargetResource
}
catch
{
Write-Host $Global:M365DSCEmojiRedX
try
{
Write-Verbose -Message $_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ function Export-TargetResource
}
catch
{
Write-Host $Global:M365DSCEmojiRedX
try
{
Write-Verbose -Message $_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ function Export-TargetResource
[System.Management.Automation.PSCredential]
$GlobalAdminAccount
)

$ConnectionMode = New-M365DSCConnection -Platform 'MicrosoftTeams' `
-InboundParameters $PSBoundParameters

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace("MSFT_", "")
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
Expand Down Expand Up @@ -398,6 +402,7 @@ function Export-TargetResource
}
catch
{
Write-Host $Global:M365DSCEmojiRedX
try
{
Write-Verbose -Message $_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ function Export-TargetResource
}
catch
{
Write-Host $Global:M365DSCEmojiRedX
try
{
Write-Verbose -Message $_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ function Export-TargetResource
}
catch
{
Write-Host $Global:M365DSCEmojiRedX
try
{
Write-Verbose -Message $_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ function Export-TargetResource
[System.Management.Automation.PSCredential]
$GlobalAdminAccount
)
$ConnectionMode = New-M365DSCConnection -Platform 'MicrosoftTeams' `
-InboundParameters $PSBoundParameters

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace("MSFT_", "")
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
Expand Down Expand Up @@ -206,6 +209,7 @@ function Export-TargetResource
}
catch
{
Write-Host $Global:M365DSCEmojiRedX
try
{
Write-Verbose -Message $_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ function Export-TargetResource
[System.Management.Automation.PSCredential]
$GlobalAdminAccount
)
$ConnectionMode = New-M365DSCConnection -Platform 'MicrosoftTeams' `
-InboundParameters $PSBoundParameters

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace("MSFT_", "")
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
Expand Down Expand Up @@ -230,6 +233,7 @@ function Export-TargetResource
}
catch
{
Write-Host $Global:M365DSCEmojiRedX
try
{
Write-Verbose -Message $_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ function Export-TargetResource
[System.Management.Automation.PSCredential]
$GlobalAdminAccount
)

$ConnectionMode = New-M365DSCConnection -Platform 'MicrosoftTeams' `
-InboundParameters $PSBoundParameters

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace("MSFT_", "")
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
Expand Down Expand Up @@ -309,6 +313,7 @@ function Export-TargetResource
}
catch
{
Write-Host $Global:M365DSCEmojiRedX
try
{
Write-Verbose -Message $_
Expand Down
Loading

0 comments on commit b3497a5

Please sign in to comment.