Edit

Share via


New-CMTSNetworkAdapterSetting

Create a settings object for a network adapter on the Apply Network Settings task sequence step.

Syntax

Default (Default)

New-CMTSNetworkAdapterSetting
    [-Dns <String[]>]
    [-EnableDnsRegistration]
    [-EnableFullDnsRegistration]
    [-EnableIpProtocolFiltering]
    [-EnableLmHosts]
    [-EnableTcpFiltering]
    [-EnableUdpFiltering]
    [-Gateway <String[]>]
    [-IpAddress <Hashtable[]>]
    [-IpProtocolFilterList <String[]>]
    [-Metric <Int32>]
    -Name <String>
    [-TcpFilterPortList <Int32[]>]
    [-TcpIpNetbiosOption <NetbiosOption>]
    [-UdpFilterPortList <Int32[]>]
    [-Wins <String[]>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This cmdlet creates a network adapter settings object. Use this object with the AddAdapterSetting parameter on the New-CMTSStepApplyNetworkSetting or Set-CMTSStepApplyNetworkSetting cmdlets.

For more information, see About task sequence steps: Apply Network Settings.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Add network adapter settings for a connection with multiple addresses

This example first defines three array variables that define the multiple addresses. The $dns variable is an array with two DNS server addresses. The $gw variable is an array with two gateway addresses. The $ip variable is an array with two hashtables. Each hashtable defines an IP address and subnet mask pair.

The next line of the example uses the New-CMTSNetworkAdapterSetting cmdlet to create the network adapter settings object. It uses the defined variables, and sets several other options.

The final part of this example configures an existing Apply Network Settings step of a task sequence named Default OS deployment. It adds the network adapter settings to the step, and configures the DNS suffix.

$dns = @("192.168.1.100","10.0.1.100")
$gw = @("192.168.1.1","10.0.1.1")

$ip = @(
    @{ IP = "192.168.1.42"; Mask = "255.255.255.0"; },
    @{ IP = "10.0.1.42"; Mask = "255.255.242.0"; }
)

$conn1 = New-CMTSNetworkAdapterSetting -Name "local connection" -Dns $dns -EnableDnsRegistration -EnableFullDnsRegistration -Gateway $gw -IpAddress $ip -TcpIpNetbiosOption DisableNetbiosOverTcpip

$tsNameOsd = "Default OS deployment"
$tsStepNameApplyNetSet = "Apply Network Settings"

Set-CMTSStepApplyNetworkSetting -TaskSequenceName $tsNameOsd -StepName $tsStepNameApplyNetSet -AddAdapterSetting $conn1 -DnsSuffix "corp.contoso.com"

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
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

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

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

-Dns

Specify one or more DNS server addresses in order of use.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:DNSServerAddress, DNSServerAddresses

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableDnsRegistration

Add this parameter to register this connection's addresses in DNS. This setting applies to all connections with TCP/IP enabled. To specify the DNS suffix, use the DnsSuffix parameter on the New-CMTSStepApplyNetworkSetting or Set-CMTSStepApplyNetworkSetting cmdlets.

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

-EnableFullDnsRegistration

Add this parameter to use the connection's DNS suffix in DNS registration. This setting applies to all connections with TCP/IP enabled. To specify the DNS suffix, use the DnsSuffix parameter on the New-CMTSStepApplyNetworkSetting or Set-CMTSStepApplyNetworkSetting cmdlets.

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

-EnableIpProtocolFiltering

Add this parameter to filter some IP protocols. To enable TCP/IP filtering, use the EnableTcpIpFiltering parameter on the New-CMTSStepApplyNetworkSetting or Set-CMTSStepApplyNetworkSetting cmdlets.

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

-EnableLmHosts

Add this parameter to enable LMHOSTS lookup.

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

-EnableTcpFiltering

Add this parameter to filter some TCP ports. To enable TCP/IP filtering, use the EnableTcpIpFiltering parameter on the New-CMTSStepApplyNetworkSetting or Set-CMTSStepApplyNetworkSetting cmdlets.

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

-EnableUdpFiltering

Add this parameter to filter some UDP ports. To enable TCP/IP filtering, use the EnableTcpIpFiltering parameter on the New-CMTSStepApplyNetworkSetting or Set-CMTSStepApplyNetworkSetting cmdlets.

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

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

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

-Gateway

If this connection doesn't use DHCP, use this parameter to specify one or more gateway addresses.

If needed, use the Metric parameter. By default, the gateway uses an automatic metric.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:GatewayIpAddress, GatewayIpAddresses

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IpAddress

If this connection doesn't use DHCP, use this parameter to specify one or more IP addresses and corresponding subnet masks. The value is a hashtable. The first value is the IP and the second value is the Mask.

For example: @{ IP = "192.168.1.42"; Mask = "255.255.255.0"; }

If you need to specify more than one IP address and subnet mask combination, use an array of hashtables.

For example: @( @{ IP = "192.168.1.42"; Mask = "255.255.255.0"; }, @{ IP = "10.0.1.42"; Mask = "255.255.242.0"; } )

Parameter properties

Type:

Hashtable[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:NetworkSettingIpAddress, NetworkSettingIpAddresses

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IpProtocolFilterList

When you use the EnableIpProtocolFiltering parameter, use this parameter to specify one or more IP protocols.

Parameter properties

Type:

String[]

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

-Metric

Specify the metric that indicates the cost of using the Gateway. If you don't specify this parameter, the gateway uses an automatic metric.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:GatewayCostMetric

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specify a unique name for this connection.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TcpFilterPortList

When you use the EnableTcpFiltering parameter, use this parameter to specify one or more TCP ports.

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

-TcpIpNetbiosOption

Specify whether to enable or disable NetBIOS over TCP/IP.

Parameter properties

Type:NetbiosOption
Default value:None
Accepted values:Default, EnableNetbiosOverTcpip, DisableNetbiosOverTcpip
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

-UdpFilterPortList

When you use the EnableUdpFiltering parameter, use this parameter to specify one or more UDP ports.

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 doesn't run.

Parameter properties

Type:SwitchParameter
Default value:None
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

-Wins

Specify one or more WINS server addresses.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:WinsServerAddress, WinsServerAddresses

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

None

Outputs

IResultObject

Notes

For more information on this return object and its properties, see SMS_TaskSequence_NetworkAdapterSettings server WMI class.