Table of contents
ISE
TOC
Collapse the table of content
Expand the table of content

Update-DscConfiguration

JuanPablo Jofre|Last Updated: 12/17/2016
|
3 Contributors

SYNOPSIS

Runs the existing configuration on a computer.

SYNTAX

ComputerNameSet (Default)

Update-DscConfiguration [[-ComputerName] <String[]>] [-Credential <PSCredential>] [-Wait] [-JobName <String>]
 [-WhatIf] [-Confirm] [<CommonParameters>]

CimSessionSet

Update-DscConfiguration -CimSession <CimSession[]> [-Wait] [-JobName <String>] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

The Update-DscConfiguration cmdlet runs the existing configuration present on a computer or connects to a pull server and then applies the current configuration to the computer.

This cmdlet is available only as part of the November 2014 update rollup for Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2http://support.microsoft.com/en-us/kb/3000850 (http://support.microsoft.com/en-us/kb/3000850) from the Microsoft Support library. Before you use this cmdlet, review the information in What's New in Windows PowerShellhttp://technet.microsoft.com/library/hh857339.aspx (http://technet.microsoft.com/library/hh857339.aspx) in the TechNet library.

EXAMPLES

Example 1: Update a configuration

PS C:\> $Session = New-CimSession -ComputerName "Server01" -Credential ACCOUNTS\PattiFuller
PS C:\> Update-DscConfiguration -CimSession $Session -Wait

The first command creates a CIM session by using the New-CimSession cmdlet, and then stores the CimSession object in the $Session variable. The command prompts you for a password. For more information, type Get-Help New-CimSession.

The second command updates the computer specified in the CimSession stored in $Session. The command specifies the Wait parameter. The console does not accept additional commands until the current command finishes.

PARAMETERS

-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-CimSessionhttp://go.microsoft.com/fwlink/p/?LinkId=227967 or Get-CimSessionhttp://go.microsoft.com/fwlink/p/?LinkId=227966 cmdlet. The default is the current session on the local computer.

Type: CimSession[]
Parameter Sets: CimSessionSet
Aliases: 

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ComputerName

Specifies an array of computer names. The cmdlet applies the configuration settings to the computers that this parameter specifies.

Type: String[]
Parameter Sets: ComputerNameSet
Aliases: CN, ServerName

Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Credential

Specifies a user name and password, as a PSCredential object, for the target computer. To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.

Type: PSCredential
Parameter Sets: ComputerNameSet
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-JobName

Specifies a friendly name for a job. If you specify this parameter, the cmdlet runs as a job, and it returns a Job object.

By default, Windows PowerShell® assigns the name JobN where N is an integer.

If you specify the Wait parameter, do not specify this parameter.

Type: String
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Wait

Indicates that the cmdlet blocks the console until it completes all configuration tasks.

If you specify this parameter, do not specify the JobName parameter.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

OUTPUTS

NOTES

Windows PowerShell Desired State Configuration Overview

Get-DscConfiguration

Restore-DscConfiguration

Start-DscConfiguration

Stop-DscConfiguration

Test-DscConfiguration

© 2017 Microsoft