Skip to content

Commit

Permalink
Merge pull request #5493 from kasaxena5/fixesForPS7
Browse files Browse the repository at this point in the history
Minor fixes in MSFT_EXOClientAccessRule.psm1 and MSFT_EXOAuthenticationPolicyAssignment.psm1
  • Loading branch information
NikCharlebois authored Dec 4, 2024
2 parents 3c61719 + aab89b5 commit a0a78ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
* Added support for AccessTokens.
* AADRoleManagementPolicyRule
* Added the logic to handle filters in the Export logic flow.
* EXOAuthenticationPolicyAssignment
* Added $confirm flag to the Set-TargetResource function for PowerShell 7 compatibility.
* EXOClientAccessRule
* Added $confirm flag to the Set-TargetResource function for PowerShell 7 compatibility.
* EXOManagementRoleAssignment
* Changed logic to detect drift.
* EXOTeamsProtectionPolicy
Expand All @@ -30,6 +34,7 @@
* M365DSCDRGUtil
* Add separate check for strings with ordinal comparison and standardized line breaks.


# 1.24.1127.1

* AAD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ function Set-TargetResource
if ($Ensure -eq 'Present')
{
Write-Verbose -Message "Assigning authentication policy {$AuthenticationPolicyName} to {$UserName}."
Set-User -Identity $UserName -AuthenticationPolicy $AuthenticationPolicyName | Out-Null
Set-User -Identity $UserName -AuthenticationPolicy $AuthenticationPolicyName -Confirm:$false | Out-Null
}
# CASE: Authentication Policy exists but it shouldn't;
elseif ($Ensure -eq 'Absent' -and $currentPolicyAssignment.Ensure -eq 'Present')
{
Write-Verbose -Message "Removing authentication policy assignment {$AuthenticationPolicyName} for {$UserName}."
Set-User -Identity $UserName -AuthenticationPolicy $null | Out-Null
Set-User -Identity $UserName -AuthenticationPolicy $null -Confirm:$false | Out-Null
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ function Set-TargetResource
Write-Verbose -Message "Creating ClientAccessRule $($Identity)."
$ClientAccessRuleParams.Add('Name', $Identity)
$ClientAccessRuleParams.Remove('Identity') | Out-Null
New-ClientAccessRule @ClientAccessRuleParams
New-ClientAccessRule @ClientAccessRuleParams -Confirm:$false
}
elseif (('Present' -eq $Ensure ) -and ($Null -ne $ClientAccessRule))
{
Expand Down

0 comments on commit a0a78ca

Please sign in to comment.