Skip to content

Commit

Permalink
Merge pull request #5835 from NikCharlebois/Various-EXO-fixes
Browse files Browse the repository at this point in the history
Various AAD fixes
  • Loading branch information
NikCharlebois authored Feb 24, 2025
2 parents 627988d + d85b793 commit a7409a3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
* AADAppplication
* Fixed an issue where specifying an empty ReplyURLs array would not remove
the existing entries.
* AADAuthenticationMethodPolicy
* DEPRECATED - PolicyMigrationState property is now deprecated since it
* AADAuthenticationMethodPolicyFido2
* Fixed issue where the Set-TargetResource was throwing an internal server
error.
cannot be set.
* EXOCalendarProcessing
* Changed the Get-TargetResource logic to return UPN instead of id.
* EXODistributionGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,19 +246,11 @@ function Get-TargetResource
}
#endregion

#region resource generator code
$enumPolicyMigrationState = $null
if ($null -ne $getValue.PolicyMigrationState)
{
$enumPolicyMigrationState = $getValue.PolicyMigrationState.ToString()
}
#endregion

$results = @{
#region resource generator code
Description = $getValue.Description
DisplayName = $getValue.DisplayName
PolicyMigrationState = $enumPolicyMigrationState
#PolicyMigrationState = $enumPolicyMigrationState #DEPRECATED - Cannot be set
PolicyVersion = $getValue.PolicyVersion
ReconfirmationInDays = $getValue.ReconfirmationInDays
RegistrationEnforcement = $complexRegistrationEnforcement
Expand Down Expand Up @@ -405,6 +397,13 @@ function Set-TargetResource
$UpdateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $UpdateParameters.$key
}
}

if (-not [System.String]::IsNullOrEmpty($PolicyMigrationState))
{
Write-Verbose -Message "DEPRECATED - Property PolicyMigrationState cannot be set."
$UpdateParameters.Remove('PolicyMigrationState') | Out-Null
}

#region resource generator code
$UpdateParameters.Add('@odata.type', '#microsoft.graph.AuthenticationMethodsPolicy')
Write-Verbose -Message "Updating AuthenticationMethodPolicy with: `r`n$(Convert-M365DscHashtableToString -Hashtable $UpdateParameters)"
Expand Down Expand Up @@ -534,6 +533,7 @@ function Test-TargetResource
}

$ValuesToCheck.remove('Id') | Out-Null
$ValuesToCheck.remove('PolicyMigrationState') | Out-Null

Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $ValuesToCheck)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ function Set-TargetResource
}
}
#region resource generator code
Write-Verbose -Message "Parameters:`r`n$(ConvertTo-Json $UpdateParameters -Depth 10)"
$UpdateParameters.Add('@odata.type', '#microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration')
Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration `
-AuthenticationMethodConfigurationId $currentInstance.Id `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,6 @@ function Set-TargetResource
$UpdateParameters = ([Hashtable]$BoundParameters).clone()
$UpdateParameters = Rename-M365DSCCimInstanceParameter -Properties $UpdateParameters

$UpdateParameters.Remove('Id') | Out-Null

$keys = (([Hashtable]$UpdateParameters).clone()).Keys
foreach ($key in $keys)
{
Expand Down Expand Up @@ -378,7 +376,7 @@ function Set-TargetResource
}
}
#region resource generator code
$UpdateParameters.Add('@odata.type', '#microsoft.graph.fido2AuthenticationMethodConfiguration')
Write-Verbose -Message "Parameters:`r`n$(ConvertTo-Json $UpdateParameters -Depth 10)"
Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration `
-AuthenticationMethodConfigurationId $currentInstance.Id `
-BodyParameter $UpdateParameters
Expand Down

0 comments on commit a7409a3

Please sign in to comment.