Edit

Share via


New-CMTSStepApplyNetworkSetting

Create an Apply Network Settings step, which you can add to a task sequence.

Syntax

Default (Default)

New-CMTSStepApplyNetworkSetting
    [-AddAdapterSetting <IResultObject[]>]
    [-DnsSuffix <String>]
    [-DomainName <String>]
    [-DomainOU <String>]
    [-EnableTcpIpFiltering]
    [-UserName <String>]
    [-UserPassword <SecureString>]
    [-WorkgroupName <String>]
    [-Condition <IResultObject[]>]
    [-ContinueOnError]
    [-Description <String>]
    [-Disable]
    -Name <String>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This cmdlet creates a new Apply Network Settings step object. Then use the Add-CMTaskSequenceStep cmdlet to add the step to a task sequence. For more information on this step, 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

This example first uses the ConvertTo-SecureString built-in cmdlet to create a secure string for the user password. This method is used here as a simple example, but not the most secure since the plain text password is in the script. For more information on this cmdlet and other options, see ConvertTo-SecureString.

The next line creates an object for the Apply Network Settings step, using the secure string password variable.

It then gets a task sequence object, and adds this new step to the task sequence at index 11.

$Secure_String_Pwd = ConvertTo-SecureString "P@ssW0rD!" -AsPlainText -Force

$step = New-CMTSStepApplyNetworkSetting -Name "Apply network settings" -DnsSuffix "corp.contoso.com" -DomainName "na.corp.contoso.com" -DomainOU "LDAP://OU=Ops,OU=ITS,DC=na,DC=corp,DC=contoso,DC=com" -UserName "contoso\_cmosdjoin" -UserPassword $Secure_String_Pwd

$tsNameOsd = "Default OS deployment"
$tsOsd = Get-CMTaskSequence -Name $tsNameOsd -Fast

$tsOsd | Add-CMTaskSequenceStep -Step $step -InsertStepStartIndex 11

Parameters

-AddAdapterSetting

Specify a network adapter settings object to add to this step. To get this object, use the New-CMTSNetworkAdapterSetting cmdlet.

Parameter properties

Type:

IResultObject[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:AddAdapterSettings

Parameter sets

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

-Condition

Specify a condition object to use with this step. To get this object, use one of the task sequence condition cmdlets. For example, Get-CMTSStepConditionVariable.

Parameter properties

Type:

IResultObject[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Conditions

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: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

-ContinueOnError

Add this parameter to enable the step option Continue on error. When you enable this option, if the step fails, the task sequence continues.

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

-Description

Specify an optional description for this task sequence step.

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

-Disable

Add this parameter to disable this task sequence step.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DisableThisStep

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

-DnsSuffix

Specify the DNS suffix. For example, corp.contoso.com. This setting is applied to all connections with TCP/IP enabled.

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

-DomainName

To configure this step to have the computer join a domain, use this parameter to specify the name of a domain to join. Then use the following other parameters:

  • DomainOU: Optionally specify an organizational unit in which to create the new computer account
  • UserName: Specify the user account with permissions to join a computer to the domain
  • UserPassword: Specify the password for the user account.

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

-DomainOU

When you use the DomainName parameter, you can also specify the path to an organizational unit (OU). When the computer joins the domain, if it creates a new computer account, that account will be in this OU.

For example, LDAP://OU=MyOu,DC=MyDom,DC=MyCompany,DC=com

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

-EnableTcpIpFiltering

Add this parameter to enable TCP/IP filtering for the connection.

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

-Name

Specify a name for this step to identify it in the task sequence.

Parameter properties

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

Parameter sets

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

-UserName

When you use the DomainName parameter, use this parameter to specify the domain user account that's used to add the destination computer to the domain. Use the UserPassword parameter to specify the account password.

For more information, see the task sequence domain joining account.

Parameter properties

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

Parameter sets

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

-UserPassword

Specify the password as a secure string for the UserName parameter.

Parameter properties

Type:SecureString
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DomainUserPassword

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

-WorkgroupName

To configure this step to have the computer join a workgroup, use this parameter to specify the workgroup name.

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

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_ApplyNetworkSettingsAction server WMI class.