Skip to content

Commit

Permalink
Merge pull request #2154 from NikCharlebois/Fix#2151
Browse files Browse the repository at this point in the history
AADConditionalAccessPolicy: Fixes #2151
  • Loading branch information
NikCharlebois authored Jul 29, 2022
2 parents 3678370 + 7cf129b commit c2b0259
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* AADConditionalAccessPolicy
* DEPRECATED then IncludeDevices and ExcludeDevices parameters.
* Fixed issue extracting a policy that had invalid users or groups (deleted from AAD).
FIXES [#2151](https://github.com/microsoft/Microsoft365DSC/issues/2151)

# 1.22.727.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function Get-TargetResource
$IncludeUser = $null
try
{
$IncludeUser = (Get-MgUser -UserId $IncludeUserGUID).userprincipalname
$IncludeUser = (Get-MgUser -UserId $IncludeUserGUID -ErrorAction Stop).userprincipalname
}
catch
{
Expand Down Expand Up @@ -302,7 +302,7 @@ function Get-TargetResource
$ExcludeUser = $null
try
{
$ExcludeUser = (Get-MgUser -UserId $ExcludeUserGUID).userprincipalname
$ExcludeUser = (Get-MgUser -UserId $ExcludeUserGUID -ErrorAction Stop).userprincipalname
}
catch
{
Expand Down Expand Up @@ -2034,13 +2034,13 @@ function Export-TargetResource
$Results = Get-TargetResource @Params

#DEPRECATED
if ($Results.IncludeDevices.Length -gt 0)
if ($Results.IncludeDevices)
{
Write-Host "`r`n $($Global:M365DSCEmojiYellowCircle) The Include Devices parameter is deprecated. Instead use the Device Filter Mode and Device Filter Rule parameters in the portal."
$Results.Remove("IncludeDevices") | Out-Null
}
#DEPRECATED
if ($Results.ExcludeDevices.Length -gt 0)
if ($Results.ExcludeDevices)
{
Write-Host "`r`n $($Global:M365DSCEmojiYellowCircle) The Exclude Devices parameter is deprecated. Instead use the Device Filter Mode and Device Filter Rule parameters in the portal."
$Results.Remove("ExcludeDevices") | Out-Null
Expand Down

0 comments on commit c2b0259

Please sign in to comment.