Skip to content

Commit

Permalink
Merge pull request #3658 from Adamvg/Dev
Browse files Browse the repository at this point in the history
Fix #3656: AADNamedLocationPolicy: Add default CountryLookupMethod and reorganise IsTrusted assignment
  • Loading branch information
NikCharlebois authored Sep 8, 2023
2 parents 6980674 + 0240927 commit 02a6b0e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# UNRELEASED

* AADNamedLocationPolicy
* Set default value for CountryLookupMethod and removed unwanted properties
FIXES [#3656](https://github.com/microsoft/Microsoft365DSC/issues/3656)
* DEPENDENCIES
* Updated ExchangeOnlineManagement to version 3.3.0.
* Updated Microsoft.Graph modules to version 2.5.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function Set-TargetResource
[Parameter()]
[System.String]
[ValidateSet('clientIpAddress','authenticatorAppGps')]
$CountryLookupMethod,
$CountryLookupMethod = 'clientIpAddress',

[Parameter()]
[System.Boolean]
Expand Down Expand Up @@ -248,10 +248,10 @@ function Set-TargetResource
$desiredValues = @{
'@odata.type' = $OdataType
displayName = $DisplayName
isTrusted = $IsTrusted
}
if ($OdataType -eq '#microsoft.graph.ipNamedLocation')
{
$desiredValues.Add('isTrusted', $IsTrusted)
$IpRangesValue = @()
foreach ($IpRange in $IpRanges)
{
Expand Down Expand Up @@ -291,8 +291,7 @@ function Set-TargetResource
}
# Named Location should exist and will be configured to desired state
elseif ($Ensure -eq 'Present' -and $CurrentAADNamedLocation.Ensure -eq 'Present')
{
$desiredValues.Add('NamedLocationId', $currentAADNamedLocation.Id) | Out-Null
{
$VerboseAttributes = ($desiredValues | Out-String)
Write-Verbose -Message "Updating existing AAD Named Location {$Displayname)} with attributes: $VerboseAttributes"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class MSFT_AADNamedLocationPolicy : OMI_BaseResource
[Write, Description("Specifies the ID of a Named Location in Azure Active Directory.")] String Id;
[Key, Description("Specifies the Display Name of a Named Location in Azure Active Directory")] string DisplayName;
[Write, Description("Specifies the IP ranges of the Named Location in Azure Active Directory")] String IpRanges[];
[Write, Description("Specifies the isTrusted value for the Named Location in Azure Active Directory")] Boolean IsTrusted;
[Write, Description("Specifies the isTrusted value for the Named Location (IP ranges only) in Azure Active Directory")] Boolean IsTrusted;
[Write, Description("Specifies the countries and regions for the Named Location in Azure Active Directory")] String CountriesAndRegions[];
[Write, Description("Determines what method is used to decide which country the user is located in. Possible values are clientIpAddress(default) and authenticatorAppGps."), ValueMap{"clientIpAddress","authenticatorAppGps"}, Values{"clientIpAddress","authenticatorAppGps"}] String CountryLookupMethod;
[Write, Description("Specifies the includeUnknownCountriesAndRegions value for the Named Location in Azure Active Directory")] Boolean IncludeUnknownCountriesAndRegions;
Expand Down

0 comments on commit 02a6b0e

Please sign in to comment.