Skip to content

Commit

Permalink
Merge branch 'fix/microsoft#3885-AADConditionalAccessPolicy' of https…
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrola committed Nov 28, 2023
2 parents aaa6e98 + cb586e8 commit a402fa1
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 64 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Change log for Microsoft365DSC

# UNRELEASED
* AADRoleSetting
* Export sorted by DisplayName for better comparison
* Enable Filter property to be used on export
FIXES [#3919](https://github.com/microsoft/Microsoft365DSC/issues/3919)
* DEPENDENCIES
* Updated Microsoft.Graph to version 2.10.0.
* Updated MSCloudLoginAssistant to version 1.1.0.

# 1.23.1122.1

* SPOSharingSettings
* Fixes typo to re-enable export of ExternalUserExpireInDays and
ExternalUserExpirationRequired.
* DEPENDENCIES
* Updated DSCParser to version 1.4.0.0.
* Updated Microsoft.Graph to version 2.9.1.
* Updated MicrosoftTeams to version 5.8.0.

# 1.23.1115.1

* AADApplication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,7 @@ function Test-TargetResource
[Switch]
$ManagedIdentity
)
$Script:ExportMode = $false

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies
Expand Down Expand Up @@ -1379,7 +1380,7 @@ function Export-TargetResource
try
{
$Script:ExportMode = $true
[array] $Script:exportedInstances = Get-MgBetaRoleManagementDirectoryRoleDefinition -ErrorAction Stop
[array] $Script:exportedInstances = Get-MgBetaRoleManagementDirectoryRoleDefinition -Filter $Filter -Sort DisplayName -ErrorAction Stop
$i = 1
$dscContent = ''
Write-Host "`r`n" -NoNewline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -920,33 +920,6 @@ function Convert-M365DSCPlannerTaskChecklistToCIMArray
return $StringContent
}

function Get-M365DSCPlannerPlansFromGroup
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable[]])]
Param(
[Parameter(Mandatory = $true)]
[System.String]
$GroupId,

[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$Credential
)
$results = @()
$uri = "https://graph.microsoft.com/v1.0/groups/$GroupId/planner/plans"
$taskResponse = Invoke-MSCloudLoginMicrosoftGraphAPI -CloudCredential $Credential `
-Uri $uri `
-Method Get
foreach ($plan in $taskResponse.value)
{
$results += @{
Id = $plan.id
Title = $plan.title
}
}
return $results
}

function Get-M365DSCPlannerTasksFromPlan
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ function Get-TargetResource
BccExternalSharingInvitations = $SPOSharingSettings.BccExternalSharingInvitations
BccExternalSharingInvitationsList = $SPOSharingSettings.BccExternalSharingInvitationsList
RequireAnonymousLinksExpireInDays = $SPOSharingSettings.RequireAnonymousLinksExpireInDays
ExternalUserExpireInDays = $SPOCCSharingSettings.ExternalUserExpireInDays
ExternalUserExpirationRequired = $SPOCCSharingSettings.ExternalUserExpirationRequired
ExternalUserExpireInDays = $SPOSharingSettings.ExternalUserExpireInDays
ExternalUserExpirationRequired = $SPOSharingSettings.ExternalUserExpirationRequired
SharingAllowedDomainList = $allowDomains
SharingBlockedDomainList = $blockDomains
SharingDomainRestrictionMode = $SPOSharingSettings.SharingDomainRestrictionMode
Expand Down
40 changes: 20 additions & 20 deletions Modules/Microsoft365DSC/Dependencies/Manifest.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,91 @@
Dependencies = @(
@{
ModuleName = 'DSCParser'
RequiredVersion = '1.3.0.10'
RequiredVersion = '1.4.0.0'
},
@{
ModuleName = 'ExchangeOnlineManagement'
RequiredVersion = '3.4.0'
},
@{
ModuleName = 'Microsoft.Graph.Applications'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Authentication'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Beta.DeviceManagement'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Beta.Devices.CorporateManagement'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Beta.DeviceManagement.Administration'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Beta.DeviceManagement.Enrollment'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Beta.Identity.DirectoryManagement'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Beta.Identity.Governance'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Beta.Identity.SignIns'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Beta.Reports'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Beta.Teams'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.DeviceManagement.Administration'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Beta.DirectoryObjects'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Groups'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Planner'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Users'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.Graph.Users.Actions'
RequiredVersion = '2.9.0'
RequiredVersion = '2.10.0'
},
@{
ModuleName = 'Microsoft.PowerApps.Administration.PowerShell'
RequiredVersion = '2.0.177'
},
@{
ModuleName = 'MicrosoftTeams'
RequiredVersion = '5.7.1'
RequiredVersion = '5.8.0'
},
@{
ModuleName = "MSCloudLoginAssistant"
RequiredVersion = "1.0.121"
RequiredVersion = "1.1.0"
},
@{
ModuleName = 'PnP.PowerShell'
Expand Down
21 changes: 9 additions & 12 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: 2023-11-15
# Generated on: 2023-11-22

@{

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

# Version number of this module.
ModuleVersion = '1.23.1115.1'
ModuleVersion = '1.23.1122.1'

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

# ReleaseNotes of this module
ReleaseNotes = '* AADApplication
* Added support for the IsFallbackPublicClient property.
FIXES [#3906](https://github.com/microsoft/Microsoft365DSC/issues/3906)
* AADServicePrincipal
* Added support to define members.
FIXES [#3902](https://github.com/microsoft/Microsoft365DSC/issues/3902)
* EXOCASMailboxPlan
* Fixes an issue where we are not able to set the settings of a CAS
Mailbox Plan by specifying the Identity without the GUID in the name.
FIXES [#3900](https://github.com/microsoft/Microsoft365DSC/issues/3900)'
ReleaseNotes = '* SPOSharingSettings
* Fixes typo to re-enable export of ExternalUserExpireInDays and
ExternalUserExpirationRequired.
* DEPENDENCIES
* Updated DSCParser to version 1.4.0.0.
* Updated Microsoft.Graph to version 2.9.1.
* Updated MicrosoftTeams to version 5.8.0.'

# Flag to indicate whether the module requires explicit user acceptance for install/update
# RequireLicenseAcceptance = $false
Expand Down
4 changes: 2 additions & 2 deletions Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4063,8 +4063,8 @@ function Test-M365DSCModuleValidity

$InformationPreference = 'Continue'

# validate only one installation of the module is present (and it's the latest version available from the psgallery)
$latestVersion = (Find-Module -Name 'Microsoft365DSC' -Repository 'PSGallery' -Includes 'DSCResource').Version
# validate only one installation of the module is present (and it's the latest version available)
$latestVersion = (Find-Module -Name 'Microsoft365DSC' -Includes 'DSCResource').Version
$localVersion = (Get-Module -Name 'Microsoft365DSC').Version

if ($latestVersion -gt $localVersion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {

It 'Should reverse engineer resource from the export method' {
$result = Export-TargetResource @testParams
Should -Invoke -Scope It -CommandName 'Get-MgBetaRoleManagementDirectoryRoleDefinition' -ParameterFilter { $Filter -eq '' -and $Sort -eq 'DisplayName' } -Times 1
$result | Should -Not -BeNullOrEmpty
}

It 'Should reverse engineer resource from the export method with a filter' {
$testParams.Filter = "displayName eq 'Role1'"

$result = Export-TargetResource @testParams
Should -Invoke -Scope It -CommandName 'Get-MgBetaRoleManagementDirectoryRoleDefinition' -ParameterFilter { $Filter -eq "displayName eq 'Role1'" -and $Sort -eq 'DisplayName' } -Times 1
$result | Should -Not -BeNullOrEmpty
}
}
Expand Down

0 comments on commit a402fa1

Please sign in to comment.