diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fcf25972c..c73c955fb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,14 @@ # Change log for Microsoft365DSC -# UNRELEASED +# 1.25.129.1 * AADRoleEligibilityScheduleRequest * Changed the mapping logic to find Id of a custom role. * AADServicePrincipal * Fixes a regression issue when trying to export instances, the authentication parameters were no longer returned by the Get-TargetResource function. +* IntuneDeviceConfigurationPolicyiOS + * Fixes [#5594] https://github.com/microsoft/Microsoft365DSC/issues/5594 * MISC * AAD Workload * Improved performance of various resources during export. @@ -104,8 +106,6 @@ * Fix values that have a zero length whitespace character. * IntuneAppProtectionPolicyiOS * Fixes [#5589] https://github.com/microsoft/Microsoft365DSC/issues/5589 -* IntuneDeviceConfigurationPolicyiOS - * Fixes [#5594] https://github.com/microsoft/Microsoft365DSC/issues/5594 * SCAutoSensitivityLabelPolicy * Use correct parameter `DesiredValues` given to `Test-M365DSCParameterState`, contrary to `EXOTenantAllowBlockListItems` these resources are not affected diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupEligibilitySchedule/MSFT_AADGroupEligibilitySchedule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupEligibilitySchedule/MSFT_AADGroupEligibilitySchedule.psm1 index 22573f2424..62a4ea729c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupEligibilitySchedule/MSFT_AADGroupEligibilitySchedule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupEligibilitySchedule/MSFT_AADGroupEligibilitySchedule.psm1 @@ -107,7 +107,7 @@ function Get-TargetResource $GroupId = (Get-MgGroup -Filter $Filter).Id } if ($Id -notmatch '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}_member_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$') { - $getId = Get-MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule ` + $getId = Get-MgBetaIdentityGovernancePrivilegedAccessGroupEligibilitySchedule ` -Filter "Groupid eq '$GroupId'" ` -ErrorAction SilentlyContinue $Id = $getId.Id @@ -785,18 +785,23 @@ function Export-TargetResource { $groups = Get-MgGroup -Filter "MailEnabled eq false and NOT(groupTypes/any(x:x eq 'DynamicMembership'))" -Property "displayname,Id" -CountVariable CountVar -ConsistencyLevel eventual -ErrorAction Stop + $j = 1 + if ($groups.Length -eq 0) + { + Write-Host $Global:M365DSCEmojiGreenCheckMark + } + else + { + Write-Host "`r`n" -NoNewline + } foreach ($group in $groups) { - Write-Host "get group $($group.DisplayName)" + Write-Host " |---[$j/$($groups.Count)] $($group.DisplayName)" -NoNewline #region resource generator code - $getValue = Get-MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule ` + $getValue = Get-MgBetaIdentityGovernancePrivilegedAccessGroupEligibilitySchedule ` -Filter "groupId eq '$($group.Id)'" ` -All ` - -ErrorAction Stop - if($null -eq $getValue) - { - continue - } + -ErrorAction SilentlyContinue $i = 1 $dscContent = '' @@ -810,7 +815,11 @@ function Export-TargetResource } foreach ($config in $getValue) { - Write-Host " |---[$i/$($getValue.Count)] $($group.DisplayName)" -NoNewline + if ($null -ne $Global:M365DSCExportResourceInstancesCount) + { + $Global:M365DSCExportResourceInstancesCount++ + } + Write-Host " |---[$i/$($getValue.Count)] $($config.Id)" -NoNewline $params = @{ Id = $config.Id GroupDisplayName = $group.DisplayName @@ -887,8 +896,9 @@ function Export-TargetResource $i++ Write-Host $Global:M365DSCEmojiGreenCheckMark } - return $dscContent + $j++ } + return $dscContent } catch { diff --git a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 index 7d67d799a2..eb2d6744f5 100644 --- a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 +++ b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 2025-01-27 +# Generated on: 2025-01-29 @{ @@ -11,7 +11,7 @@ # RootModule = '' # Version number of this module. - ModuleVersion = '1.25.122.2' + ModuleVersion = '1.25.129.1' # Supported PSEditions # CompatiblePSEditions = @() @@ -147,59 +147,16 @@ IconUri = 'https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Dependencies/Images/Logo.png?raw=true' # ReleaseNotes of this module - ReleaseNotes = '* AADAdminConsentRequestPolicy - * Refactored the export to use a common CIMInstance function. -* AADCrossTenantAccessPolicyConfigurationDefault - * Refactored the export to use a common CIMInstance function. -* AADCrossTenantAccessPolicyConfigurationPartner - * Refactored the export to use a common CIMInstance function. -* AADGroup - * Refactored the export to use a common CIMInstance function. -* AADHomeRealmDiscoveryPolicy - * Refactored the export to use a common CIMInstance function. -* AADIdentityGovernanceLifecycleWorkflow - * Refactored the export to use a common CIMInstance function. -* AADNetworkAccessForwardingPolicy - * Refactored the export to use a common CIMInstance function. -* AADNetworkAccessForwardingProfile - * Refactored the export to use a common CIMInstance function. -* AADRemoteNetwork - * Refactored the export to use a common CIMInstance function. -* AADRoleAssignmentScheduleRequest - * Refactored the export to use a common CIMInstance function. -* AADRoleEligibilityScheduleRequest - * Fixed overall logic to prevent errors complaining about existing permissions. - * Refactored the export to use a common CIMInstance function. -* FabricAdminTenantSettings - * Fix titles that have a zero length whitespace character. -* IntuneAppProtectionPolicyAndroid - * Fixes an error retrieving the group id for assignment which resulted - in a 500 error when creating or updating an instance. -* IntuneAccountProtectionLocalUserGroupMembershipPolicy - * Fixes an issue where not all details were exported. -* IntuneAccountProtectionPolicy - * Fixes an issue where not all details were exported. -* IntuneAppConfigurationPolicy - * Fixes an issue with fetching a policy that does not exist. - FIXES [#5666](https://github.com/microsoft/Microsoft365DSC/issues/5666) -* IntuneApplicationControlPolicyWindows10 - * Fixes an issue with fetching a policy that does not exist. -* IntuneAppProtectionPolicyAndroid - * Fixes an issue with fetching a policy that does not exist. -* IntuneDeviceEnrollmentPlatformRestriction - * Fixes an issue with fetching a policy that does not exist. -* M365DSCReverse - * Only fetch tenant name if not in correct format. -* O365SearchAndIntelligenceConfigurations - * Added support for Meeting Insights settings. - * Added support for Service Principal authentication. -* SCInsiderRiskEntityList - * Fixed trailing whitespaces in the name of some properties when attempting - to set values. -* TeamsEmergencyCallRoutingPolicy - * Refactored the export to use a common CIMInstance function. -* TeamsTenantDialPlan - * Refactored the export to use a common CIMInstance function.' + ReleaseNotes = '* AADRoleEligibilityScheduleRequest + * Changed the mapping logic to find Id of a custom role. +* AADServicePrincipal + * Fixes a regression issue when trying to export instances, the authentication + parameters were no longer returned by the Get-TargetResource function. +* IntuneDeviceConfigurationPolicyiOS + * Fixes [#5594] https://github.com/microsoft/Microsoft365DSC/issues/5594 +* MISC + * AAD Workload + * Improved performance of various resources during export.' # Flag to indicate whether the module requires explicit user acceptance for install/update # RequireLicenseAcceptance = $false diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroupEligibilitySchedule.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroupEligibilitySchedule.Tests.ps1 index d021389b2d..40605f742d 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroupEligibilitySchedule.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroupEligibilitySchedule.Tests.ps1 @@ -43,7 +43,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { return "Credentials" } - Mock -CommandName Get-MgPolicyRoleManagementPolicyAssignment -MockWith { + Mock -CommandName Get-MgBetaPolicyRoleManagementPolicyAssignment -MockWith { return @( @{ PolicyIdId = 'FakeId' @@ -51,11 +51,11 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { ) } - Mock -CommandName Get-MgPolicyRoleManagementPolicyRule -MockWith { + Mock -CommandName Get-MgBetaPolicyRoleManagementPolicyRule -MockWith { return @() } - Mock -CommandName Update-MgPolicyRoleManagementPolicyRule -MockWith { + Mock -CommandName Update-MgBetaPolicyRoleManagementPolicyRule -MockWith { return @() } # Mock Write-Host to hide output during the tests @@ -83,7 +83,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Credential = $Credential; } - Mock -CommandName Get-MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith { + Mock -CommandName Get-MgBetaIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith { return $null } @@ -120,7 +120,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Credential = $Credential; } - Mock -CommandName Get-MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith { + Mock -CommandName Get-MgBetaIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith { return $null } @@ -182,7 +182,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Credential = $Credential; } - Mock -CommandName Get-MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith { + Mock -CommandName Get-MgBetaIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith { return $null } @@ -211,7 +211,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { return $null } - Mock -CommandName Get-MgPolicyRoleManagementPolicyAssignment -MockWith { + Mock -CommandName Get-MgBetaPolicyRoleManagementPolicyAssignment -MockWith { return @( @{ PolicyId = 'FakeId' @@ -219,7 +219,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { ) } - Mock -CommandName Get-MgPolicyRoleManagementPolicyRule -MockWith { + Mock -CommandName Get-MgBetaPolicyRoleManagementPolicyRule -MockWith { return @{ AdditionalProperties = @{ isExpirationRequired = $true @@ -227,7 +227,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } } - Mock -CommandName Update-MgPolicyRoleManagementPolicyRule -MockWith { + Mock -CommandName Update-MgBetaPolicyRoleManagementPolicyRule -MockWith { return @() } @@ -255,7 +255,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Credential = $Credential; } - Mock -CommandName Get-MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith { + Mock -CommandName Get-MgBetaIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith { return $null } @@ -286,7 +286,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { return $null } - Mock -CommandName Get-MgPolicyRoleManagementPolicyAssignment -MockWith { + Mock -CommandName Get-MgBetaPolicyRoleManagementPolicyAssignment -MockWith { return @( @{ PolicyId = 'FakeId' @@ -294,7 +294,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { ) } - Mock -CommandName Get-MgPolicyRoleManagementPolicyRule -MockWith { + Mock -CommandName Get-MgBetaPolicyRoleManagementPolicyRule -MockWith { return @{ AdditionalProperties = @{ isExpirationRequired = $true @@ -302,7 +302,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } } - Mock -CommandName Update-MgPolicyRoleManagementPolicyRule -MockWith { + Mock -CommandName Update-MgBetaPolicyRoleManagementPolicyRule -MockWith { return @() } } @@ -336,7 +336,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } } - Mock -CommandName Get-MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith { + Mock -CommandName Get-MgBetaIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith { return @{ Id = 'FakeStringValue' } diff --git a/Tests/Unit/Stubs/Microsoft365.psm1 b/Tests/Unit/Stubs/Microsoft365.psm1 index 2263382512..4e9e9efb2c 100644 --- a/Tests/Unit/Stubs/Microsoft365.psm1 +++ b/Tests/Unit/Stubs/Microsoft365.psm1 @@ -105524,7 +105524,7 @@ function Update-MgDeviceManagementDeviceConfigurationAssignment #endregion #region MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -function Get-MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule +function Get-MgBetaIdentityGovernancePrivilegedAccessGroupEligibilitySchedule { [CmdletBinding()] param @@ -105738,7 +105738,7 @@ function New-MgBetaIdentityGovernancePrivilegedAccessGroupEligibilityScheduleReq ) } -function Get-MgPolicyRoleManagementPolicyAssignment +function Get-MgBetaPolicyRoleManagementPolicyAssignment { [CmdletBinding()] param @@ -105829,104 +105829,6 @@ function Get-MgPolicyRoleManagementPolicyAssignment ) } -function Update-MgPolicyRoleManagementPolicyRule -{ - [CmdletBinding()] - param - ( - [Parameter()] - [System.String] - $PolicyRuleId, - - [Parameter()] - [PSObject] - $InputObject, - - [Parameter()] - [PSObject] - $BodyParameter, - - [Parameter()] - [System.String] - $ResponseHeadersVariable, - - [Parameter()] - [System.Collections.Hashtable] - $AdditionalProperties, - - [Parameter()] - [System.String] - $Id, - - [Parameter()] - [System.String] - $Name, - - [Parameter()] - [System.String] - $PolicyId, - - [Parameter()] - [System.String] - $PolicyRuleType, - - [Parameter()] - [System.String] - $PolicyType, - - [Parameter()] - [System.String] - $Priority, - - [Parameter()] - [System.String] - $RuleType, - - [Parameter()] - [System.String] - $Status, - - [Parameter()] - [System.String] - $TargetType, - - [Parameter()] - [System.String] - $TargetValue, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Break, - - [Parameter()] - [System.Collections.IDictionary] - $Headers, - - [Parameter()] - [PSObject[]] - $HttpPipelineAppend, - - [Parameter()] - [PSObject[]] - $HttpPipelinePrepend, - - [Parameter()] - [System.Uri] - $Proxy, - - [Parameter()] - [System.Management.Automation.PSCredential] - $ProxyCredential, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $ProxyUseDefaultCredentials, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm - ) -} #endregion #region Microsoft.Graph.Sites