Set-AzureADMSNamedLocationPolicy
Updates a named location policy in Azure Active Directory by PolicyId.
Syntax
Set-AzureADMSNamedLocationPolicy
-PolicyId <String>
[-OdataType <String>]
[-Id <String>]
[-DisplayName <String>]
[-IpRanges <System.Collections.Generic.List`1[Microsoft.Open.MSGraph.Model.IpRange]>]
[-IsTrusted <Boolean>]
[-CountriesAndRegions <System.Collections.Generic.List`1[Microsoft.Open.MSGraph.Model.CountriesAndRegion]>]
[-IncludeUnknownCountriesAndRegions <Boolean>]
[<CommonParameters>]
Description
This cmdlet allows an admin to update a named location policy in Azure Active Directory by PolicyId. Conditional access policies are custom rules that define an access scenario.
Examples
Example 1: Update an ip named location policy in Azure AD by PolicyId.
PS C:\> Set-AzureADMSNamedLocationPolicy -PolicyId 07a1f48d-0cbb-4c2c-8ea2-1ea00e3eb3b6 -OdataType "#microsoft.graph.ipNamedLocation" -IsTrusted $false
This command updates an ip named location policy in Azure AD by PolicyId.
Example 2: Update a country or region named location policy in Azure AD by PolicyId.
PS C:\> Set-AzureADMSNamedLocationPolicy -PolicyId 76fdfd4d-bd80-4c1e-8fd4-6abf49d121fe -OdataType "#microsoft.graph.countryNamedLocation" -IncludeUnknownCountriesAndRegions $true
This command updates a country or region named location policy in Azure AD by PolicyId.
Parameters
-CountriesAndRegions
Specifies the countries and regions for the named location policy in Azure Active Directory.
Type: | List<T>[Microsoft.Open.MSGraph.Model.CountriesAndRegion] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisplayName
Specifies the display name of a named location policy in Azure Active Directory.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
{{ Fill Id Description }}
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IncludeUnknownCountriesAndRegions
Specifies the includeUnknownCountriesAndRegions value for the named location policy in Azure Active Directory.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IpRanges
Specifies the ip ranges of the named location policy in Azure Active Directory.
Type: | List<T>[Microsoft.Open.MSGraph.Model.IpRange] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IsTrusted
Specifies the isTrusted value for the named location policy in Azure Active Directory.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OdataType
Specifies the odata type of a named location policy object in Azure Active Directory.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PolicyId
Specifies the ID of a named location policy in Azure Active Directory.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Notes
See the migration guide for Set-AzureADMSNamedLocationPolicy to the Microsoft Graph PowerShell.