Skip to content

Commit

Permalink
Merge pull request #3780 from NikCharlebois/Fixes-Deleted-members-for…
Browse files Browse the repository at this point in the history
…-Authenticator-Policy

Fixes for null assignment in authentication policy
  • Loading branch information
NikCharlebois authored Oct 11, 2023
2 parents 469e4b7 + 0f8503b commit 5cbf622
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change log for Microsoft365DSC

# UNRELEASED

* AADAuthenticationMethodPolicyAuthenticator
* Fixes an issue with the Get method when an assigned group
was deleted.

# 1.23.1011.1

* AADRoleEligibilityScheduleRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,12 @@ function Get-TargetResource
$myExcludeTargets = @{}
if ($currentExcludeTargets.id -ne 'all_users')
{
$myExcludeTargetsDisplayName = Get-MgGroup -GroupId $currentExcludeTargets.id
$myExcludeTargets.Add('Id', $myExcludeTargetsDisplayName.DisplayName)
$myExcludeTargetsDisplayName = Get-MgGroup -GroupId $currentExcludeTargets.id -ErrorAction SilentlyContinue

if ($null -ne $myIncludeTargetsDisplayName)
{
$myExcludeTargets.Add('Id', $myExcludeTargetsDisplayName.DisplayName)
}
}
else
{
Expand All @@ -271,8 +275,11 @@ function Get-TargetResource
$myIncludeTargets = @{}
if ($currentIncludeTargets.id -ne 'all_users')
{
$myIncludeTargetsDisplayName = Get-MgGroup -GroupId $currentIncludeTargets.id
$myIncludeTargets.Add('Id', $myIncludeTargetsDisplayName.DisplayName)
$myIncludeTargetsDisplayName = Get-MgGroup -GroupId $currentIncludeTargets.id -ErrorAction SilentlyContinue
if ($null -ne $myIncludeTargetsDisplayName)
{
$myIncludeTargets.Add('Id', $myIncludeTargetsDisplayName.DisplayName)
}
}
else
{
Expand Down

0 comments on commit 5cbf622

Please sign in to comment.