Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.25.129.1 #5691

Merged
merged 34 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b9c3675
Changed logic to Evaluate Ensure
NikCharlebois Jan 21, 2025
d6241e6
Update CHANGELOG.md
NikCharlebois Jan 21, 2025
8794e2a
Fixing Whitespace
NikCharlebois Jan 21, 2025
199d381
FIxes
NikCharlebois Jan 21, 2025
0d675f6
Added Devices as member to AADGroup
Jan 22, 2025
50284ee
Merge branch 'Dev' into Remove-quick-Exit-on-Ensure-is-Absent
NikCharlebois Jan 22, 2025
3f0a694
Fixes Exported Instances
NikCharlebois Jan 22, 2025
d624fc3
Unit Fixes Tests
NikCharlebois Jan 22, 2025
6be8538
Update MSFT_IntuneDeviceCompliancePolicyAndroid.psm1
NikCharlebois Jan 22, 2025
1e3c1ba
Revert "Fixes Exported Instances"
NikCharlebois Jan 22, 2025
9f8a662
Fixes Unit Tests
NikCharlebois Jan 22, 2025
5d0d1ff
Fix for issue #5594
dannyKBjj Jan 22, 2025
8a5b387
Updated changelog.md
dannyKBjj Jan 22, 2025
3846690
Update MSFT_IntuneDeviceConfigurationPolicyiOS.psm1
dannyKBjj Jan 26, 2025
3f34a0d
Merge branch 'microsoft:Dev' into Dev
AlfredSchreuder Jan 27, 2025
5d27853
Synced fork & fixed changelog
Jan 27, 2025
690c3f8
Merge branch 'Dev' into Dev
ykuijs Jan 28, 2025
655e2e4
Merge pull request #5660 from AlfredSchreuder/Dev
ykuijs Jan 28, 2025
69890be
Merge pull request #5657 from NikCharlebois/Remove-quick-Exit-on-Ensu…
NikCharlebois Jan 28, 2025
6068b48
Improve performance of AAD resources
FabienTschanz Jan 28, 2025
28dd0c7
AADRoleEligibilityScheduleRequest Fix
NikCharlebois Jan 28, 2025
a3666c5
Update MSFT_AADRoleEligibilityScheduleRequest.psm1
NikCharlebois Jan 28, 2025
32a2fe8
Update MSFT_AADRoleEligibilityScheduleRequest.psm1
NikCharlebois Jan 29, 2025
3296f6b
Merge pull request #5685 from NikCharlebois/AADRoleEligibilitySchedul…
NikCharlebois Jan 29, 2025
97f6abc
Merge branch 'Dev' into feat/aad-performance
NikCharlebois Jan 29, 2025
efbf93d
Various Fixes
NikCharlebois Jan 29, 2025
29abf3f
Merge pull request #5688 from NikCharlebois/Various-Fixes
NikCharlebois Jan 29, 2025
2e80c5c
Merge pull request #5684 from FabienTschanz/feat/aad-performance
NikCharlebois Jan 29, 2025
6b11694
Merge pull request #5661 from dannyKBjj/Fix-issue-#5594---IntuneDevic…
NikCharlebois Jan 29, 2025
a765944
Release 1.25.129.1
NikCharlebois Jan 29, 2025
5c61dc1
Visual fixes for export.
NikCharlebois Jan 29, 2025
8cfb7c2
Fixes cmdlet name
NikCharlebois Jan 29, 2025
161c222
Update Microsoft365.psm1
NikCharlebois Jan 29, 2025
a2aaf5d
Merge pull request #5690 from NikCharlebois/Release-1.25.129.1
NikCharlebois Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Change log for Microsoft365DSC

# 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.

# 1.25.122.2

* AADAdminConsentRequestPolicy
Expand All @@ -10,6 +23,7 @@
* Refactored the export to use a common CIMInstance function.
* AADGroup
* Refactored the export to use a common CIMInstance function.
* Added functionality to add & check on Devices in AAD groups.
* AADHomeRealmDiscoveryPolicy
* Refactored the export to use a common CIMInstance function.
* AADIdentityGovernanceLifecycleWorkflow
Expand Down Expand Up @@ -122,6 +136,11 @@
making the comparison otherwise it may fail as it did for a few resources
FIXES [#5648](https://github.com/microsoft/Microsoft365DSC/issues/5648)
* MISC
* Modified 100+ Test-TargetResource logic to prevent returning $false when
the Ensure parameter doesn't match the desired value. While this could introduce
a very small performance gain in some cases, it resulted in a lot of drifts being
detected without proper logging. All evaluation, including of the Ensure property,
is now being handled by the Test-M365DSCParameterState function.
* Export Performance Improvements
Implements the changes described in [#5615](https://github.com/microsoft/Microsoft365DSC/issues/5615)
Improved resource caching behavior across Intune resources.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,47 +68,54 @@ function Get-TargetResource

try
{
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '')
$CommandName = $MyInvocation.MyCommand
$data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName `
-CommandName $CommandName `
-Parameters $PSBoundParameters
Add-M365DSCTelemetryEvent -Data $data
#endregion
if (-not $Script:exportedInstance)
{
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters

$nullResult = $PSBoundParameters
$nullResult.Ensure = 'Absent'
#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies

$getValue = $null
#region resource generator code
$getValue = Get-MgBetaIdentityGovernanceAccessReviewDefinition -AccessReviewScheduleDefinitionId $Id -ErrorAction SilentlyContinue
#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '')
$CommandName = $MyInvocation.MyCommand
$data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName `
-CommandName $CommandName `
-Parameters $PSBoundParameters
Add-M365DSCTelemetryEvent -Data $data
#endregion

if ($null -eq $getValue)
{
Write-Verbose -Message "Could not find an Azure AD Access Review Definition with Id {$Id}"
$nullResult = $PSBoundParameters
$nullResult.Ensure = 'Absent'

if (-not [System.String]::IsNullOrEmpty($DisplayName))
$getValue = $null
#region resource generator code
$getValue = Get-MgBetaIdentityGovernanceAccessReviewDefinition -AccessReviewScheduleDefinitionId $Id -ErrorAction SilentlyContinue

if ($null -eq $getValue)
{
$getValue = Get-MgBetaIdentityGovernanceAccessReviewDefinition `
-Filter "DisplayName eq '$DisplayName'" `
-ErrorAction SilentlyContinue | Where-Object `
-FilterScript {
$_.AdditionalProperties.'@odata.type' -eq '#microsoft.graph.AccessReviewScheduleDefinition'
Write-Verbose -Message "Could not find an Azure AD Access Review Definition with Id {$Id}"

if (-not [System.String]::IsNullOrEmpty($DisplayName))
{
$getValue = Get-MgBetaIdentityGovernanceAccessReviewDefinition `
-Filter "DisplayName eq '$DisplayName'" `
-ErrorAction SilentlyContinue | Where-Object `
-FilterScript {
$_.AdditionalProperties.'@odata.type' -eq '#microsoft.graph.AccessReviewScheduleDefinition'
}
}
}
#endregion
if ($null -eq $getValue)
{
Write-Verbose -Message "Could not find an Azure AD Access Review Definition with DisplayName {$DisplayName}."
return $nullResult
}
}
#endregion
if ($null -eq $getValue)
else
{
Write-Verbose -Message "Could not find an Azure AD Access Review Definition with DisplayName {$DisplayName}."
return $nullResult
$getValue = $Script:exportedInstance
}
$Id = $getValue.Id
Write-Verbose -Message "An Azure AD Access Review Definition with Id {$Id} and DisplayName {$DisplayName} was found"
Expand Down Expand Up @@ -670,12 +677,6 @@ function Test-TargetResource

$CurrentValues = Get-TargetResource @PSBoundParameters
$ValuesToCheck = ([Hashtable]$PSBoundParameters).clone()

if ($CurrentValues.Ensure -ne $Ensure)
{
Write-Verbose -Message "Test-TargetResource returned $false"
return $false
}
$testResult = $true

#Compare Cim instances
Expand Down Expand Up @@ -820,6 +821,7 @@ function Export-TargetResource
AccessTokens = $AccessTokens
}

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,35 @@ function Get-TargetResource
$AccessTokens
)

New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters | Out-Null

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '')
$CommandName = $MyInvocation.MyCommand
$data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName `
-CommandName $CommandName `
-Parameters $PSBoundParameters
Add-M365DSCTelemetryEvent -Data $data
#endregion

$nullResult = $PSBoundParameters
try
{
$instance = Get-MgBetaPolicyAccessReviewPolicy -ErrorAction Stop
if ($null -eq $instance)
if (-not $Script:exportedInstance)
{
New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters | Out-Null

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '')
$CommandName = $MyInvocation.MyCommand
$data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName `
-CommandName $CommandName `
-Parameters $PSBoundParameters
Add-M365DSCTelemetryEvent -Data $data
#endregion

$nullResult = $PSBoundParameters
$instance = Get-MgBetaPolicyAccessReviewPolicy -ErrorAction SilentlyContinue
if ($null -eq $instance)
{
throw 'Could not retrieve the Access Review Policy'
}
}
else
{
throw 'Could not retrieve the Access Review Policy'
$instance = $Script:exportedInstance
}

$results = @{
Expand Down Expand Up @@ -277,7 +284,6 @@ function Export-TargetResource

try
{
$Script:ExportMode = $true
[array] $Script:exportedInstances = Get-MgBetaPolicyAccessReviewPolicy -ErrorAction Stop

$i = 1
Expand Down Expand Up @@ -310,6 +316,7 @@ function Export-TargetResource
AccessTokens = $AccessTokens
}

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,32 +60,39 @@ function Get-TargetResource

try
{
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '')
$CommandName = $MyInvocation.MyCommand
$data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName `
-CommandName $CommandName `
-Parameters $PSBoundParameters
Add-M365DSCTelemetryEvent -Data $data
#endregion
if (-not $Script:exportedInstance)
{
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '')
$CommandName = $MyInvocation.MyCommand
$data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName `
-CommandName $CommandName `
-Parameters $PSBoundParameters
Add-M365DSCTelemetryEvent -Data $data
#endregion

$nullResult = $PSBoundParameters
$nullResult.Ensure = 'Absent'
$nullResult = $PSBoundParameters
$nullResult.Ensure = 'Absent'

$getValue = $null
#region resource generator code
$getValue = Get-MgBetaPolicyActivityBasedTimeoutPolicy -ErrorAction SilentlyContinue
#endregion
if ($null -eq $getValue)
$getValue = $null
#region resource generator code
$getValue = Get-MgBetaPolicyActivityBasedTimeoutPolicy -ErrorAction SilentlyContinue
#endregion
if ($null -eq $getValue)
{
Write-Verbose -Message "Could not find an Azure AD Activity Based Timeout Policy with DisplayName {$DisplayName}"
return $nullResult
}
}
else
{
Write-Verbose -Message "Could not find an Azure AD Activity Based Timeout Policy with DisplayName {$DisplayName}"
return $nullResult
$getValue = $Script:exportedInstance
}
$Id = $getValue.Id
Write-Verbose -Message "An Azure AD Activity Based Timeout Policy with Id {$Id} and DisplayName {$DisplayName} was found."
Expand Down Expand Up @@ -385,12 +392,6 @@ function Test-TargetResource

$CurrentValues = Get-TargetResource @PSBoundParameters
$ValuesToCheck = ([Hashtable]$PSBoundParameters).clone()

if ($CurrentValues.Ensure -ne $Ensure)
{
Write-Verbose -Message "Test-TargetResource returned $false"
return $false
}
$testResult = $true

#Compare Cim instances
Expand Down Expand Up @@ -531,6 +532,7 @@ function Export-TargetResource
AccessTokens = $AccessTokens
}

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,35 @@ function Get-TargetResource
$AccessTokens
)

New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters | Out-Null

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '')
$CommandName = $MyInvocation.MyCommand
$data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName `
-CommandName $CommandName `
-Parameters $PSBoundParameters
Add-M365DSCTelemetryEvent -Data $data
#endregion

$nullResult = $PSBoundParameters
try
{
$instance = Get-MgBetaPolicyAdminConsentRequestPolicy -ErrorAction Stop
if ($null -eq $instance)
if (-not $Script:exportedInstance)
{
New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters | Out-Null

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '')
$CommandName = $MyInvocation.MyCommand
$data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName `
-CommandName $CommandName `
-Parameters $PSBoundParameters
Add-M365DSCTelemetryEvent -Data $data
#endregion

$nullResult = $PSBoundParameters
$instance = Get-MgBetaPolicyAdminConsentRequestPolicy -ErrorAction SilentlyContinue
if ($null -eq $instance)
{
throw 'Could not retrieve the Admin Consent Request Policy'
}
}
else
{
throw 'Could not retrieve the Admin Consent Request Policy'
$instance = $Script:exportedInstance
}

$reviewersValue = @()
Expand Down Expand Up @@ -431,7 +438,6 @@ function Export-TargetResource

try
{
$Script:ExportMode = $true
[array] $Script:exportedInstances = Get-MgBetaPolicyAdminConsentRequestPolicy -ErrorAction Stop

$i = 1
Expand Down Expand Up @@ -464,6 +470,7 @@ function Export-TargetResource
AccessTokens = $AccessTokens
}

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -890,12 +890,6 @@ function Test-TargetResource

$CurrentValues = Get-TargetResource @PSBoundParameters
$ValuesToCheck = ([Hashtable]$PSBoundParameters).clone()

if ($CurrentValues.Ensure -ne $Ensure)
{
Write-Verbose -Message "Test-TargetResource returned $false - Ensure not the same"
return $false
}
$testResult = $true

#Compare Cim instances
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ function Set-TargetResource
{
Write-Verbose -Message "Updating for Azure AD Application {$($currentAADApp.DisplayName)} with KeyCredentials:`r`n$($KeyCredentials| Out-String)"

if ((currentAADApp.KeyCredentials.Length -eq 0 -and $KeyCredentials.Length -eq 1) -or (currentAADApp.KeyCredentials.Length -eq 1 -and $KeyCredentials.Length -eq 0))
if (($currentAADApp.KeyCredentials.Length -eq 0 -and $KeyCredentials.Length -eq 1) -or ($currentAADApp.KeyCredentials.Length -eq 1 -and $KeyCredentials.Length -eq 0))
{
Update-MgApplication -ApplicationId $currentAADApp.Id -KeyCredentials $KeyCredentials | Out-Null
}
Expand Down
Loading
Loading