Set-VpnIPAddressAssignment
Configures the IPv4 address assignment method or the IPv6 prefix for IPv6 address assignment.
Syntax
VpnIPAddressAssignment (Default)
Set-VpnIPAddressAssignment
[-IPAddressRange <String[]>]
[-ComputerName <String>]
[-IPAssignmentMethod <String>]
[-IPv6Prefix <String>]
[-PassThru]
[-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>]
[-AsJob]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
VpnIPv6PrefixEntrypoint
Set-VpnIPAddressAssignment
-IPv6Prefix <String>
-EntrypointName <String>
[-ComputerName <String>]
[-PassThru]
[-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>]
[-AsJob]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-VpnIPAddressAssignment cmdlet is only used to toggle from one IPv4 address assignment type to another. This cmdlet cannot be used to add additional IPv4 address ranges if a static pool IP address assignment is being used.
-- This cmdlet cannot be used to Enable or Disable an IPv4 or IPv6 address assignment.
Examples
EXAMPLE 1
PS C:\>Set-VpnIPAddressAssignment -IPAssignmentMethod "Dhcp" -PassThru
IPAssignmentMethod : Dhcp
IPAddressRangeList :
IPv6Prefix :
This cmdlet sets the IPv4 address assignment type to be DHCP which causes IPv4 address assignment to happen from a DHCP server.
EXAMPLE 2
PS C:\>Set-VpnIPAddressAssignment -IPAssignmentMethod "StaticPool" -IPAddressRange "30.1.1.10", "30.1.1.30" -IPv6Prefix "2002:836b:2:1000::/64" -PassThru
WARNING: The remoteaccess service must be restarted for the changes to take effect.
IPAssignmentMethod : StaticPool
IPAddressRangeList : {30.1.1.10 - 30.1.1.30}
IPv6Prefix : 2002:836b:2:1000::/64
The cmdlet specifies the IPv4 address assignment to happen from the IP range 30.1.1.10 through 30.1.1.30. IPv6 prefix 2002:836b:2:1000::/64 is used for IPv6 address assignment. Changing the IPv6 prefix requires the remote access service to be restarted in order to take effect. This is conveyed through the warning message.
Parameters
-AsJob
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-CimSession
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.
Parameter properties
Type: | CimSession[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | Session |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ComputerName
Specifies the IPv4 or IPv6 address, or host name, of the computer on which the VPN server computer specific tasks should be run. If this parameter is specified, then the address assignment properties are configured for that VPN server.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | Cn |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | cf |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-EntrypointName
Specifies a site in a multi-site deployment for which the IPv6 prefix needs to be configured. This parameter is not applicable to the IPv4 address assignment properties as these properties are always configured at the individual server level and not site level.
If this parameter is not specified in a multi-site deployment, then this parameter value to which the cmdlet is run is used. The server could also be represented by using the ComputerName parameter.
If this parameter and the ComputerName parameter are specified and the ComputerName does not belong to the site represented by this parameter, then this parameter takes precedence and the authentication type is configured for it.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
VpnIPv6PrefixEntrypoint
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-IPAddressRange
Specifies the IP address range from which IP addresses are allocated to VPN clients. Consists of a starting IP and an ending IP. This parameter can be configured only if the IPAssignmentMethod parameter is specified to be StaticPool.
If there are no pre-existing IPv4 address pools, then it is mandatory to specify an address range.
Parameter properties
Type: | String[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
VpnIPAddressAssignment
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-IPAssignmentMethod
Specifies the mechanism for IPv4 address assignment. The acceptable values for this parameter are:
-- Dhcp.
-- StaticPool.
When load balancing is active the IPv4 address assignment method cannot be configured to DHCP. Only a static pool is supported.
Parameter properties
Type: | String |
Default value: | None |
Accepted values: | Dhcp, StaticPool |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
VpnIPAddressAssignment
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-IPv6Prefix
Specifies the IPv6 prefix used for IPv6 address assignment.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
VpnIPAddressAssignment
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-PassThru
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ThrottleLimit
Specifies the maximum number of concurrent operations that can be established to run the cmdlet.
If this parameter is omitted or a value of 0
is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer.
The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Parameter properties
Type: | Int32 |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | wi |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
String
String
Outputs
CimInstance
CimInstance
The Microsoft.Management.Infrastructure.CimInstance
object is a wrapper class that displays Windows Management Instrumentation (WMI) objects.
The path after the pound sign (#
) provides the namespace and class name for the underlying WMI object.
The object consists of the following properties:
-- The IPv4 assignment method configured: DHCP or static pool.
-- If static pool assignment is configured for IPv4, then the list of configured address pools. Each pool consists of a starting IP address and an ending IP address.
-- The IPv6 prefix configured.