Start-DscConfiguration

Apply Desired State configuration to nodes. (PowerShell 4.0+)

Syntax
      Start-DscConfiguration [[-ComputerName] String[]] [-Path] String
         [-Credential ] [-Force] [-JobName ] [-ThrottleLimit Int32]
            [-Wait] [-Confirm] [-WhatIf] [CommonParameters]
    
      Start-DscConfiguration [-Path] String [-Force] [-JobName String]
         [-ThrottleLimit ] -CimSession CimSession[]
            [-Wait] [-Confirm] [-WhatIf] [CommonParameters]

Key
   -CimSession CimSession[]
       Run 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.
        
   -ComputerName String[]
       Specify an array of computer names.
       The cmdlet publishes and applies the configuration in the location specified by the -Path parameter to
       these computers.
        
   -Credential PSCredential
       A user name and password, as a PSCredential object, for the target computer.
       To obtain a PSCredential object, use Get-Credential.
        
   -Force 
       Indicates that the cmdlet pushes configuration to computers.
       Some computers pull configuration data. If you do not specify this parameter and if the computer pulls
       its configuration, the configuration fails.
        
   -JobName String
       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, PowerShell assigns the name JobN where N is an integer.
       If you specify -Wait, do not specify -JobName.
        
   -Path String
       The file path of a folder that contains configuration settings files.
       The cmdlet publishes and applies this configuration to computers specified by -ComputerName.
        
   -ThrottleLimit Int32
       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 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.

   -Wait
       Block the console until it completes all configuration tasks.
       If you specify this parameter, do not specify the JobName parameter.

   -Confirm
       Prompt for confirmation before executing the command.

   -WhatIf
       Describe what would happen if you executed the command without actually
       executing the command.

Start-DscConfiguration applies configuration to nodes. Specify which computers you want to apply configuration to by specifying computer names or by using Common Information Model (CIM) sessions.

By default, this cmdlet creates a job and returns a Job object.

To use this cmdlet interactively, specify the -Wait parameter.
Specify the -Verbose parameter to see details of what the cmdlet does when it applies configuration settings.

Examples

Apply the configuration settings from C:\SS64\Configurations\ to every computer that has settings in that folder,returning Job objects for each target node:

PS C:\> Start-DscConfiguration -Path "C:\SS64\Configurations\"

Apply the configuration settings from C:\SS64\Configurations\ to the local computer:

PS C:\> Start-DscConfiguration -Path "C:\SS64\Configurations\" -Wait -Verbose

Apply configuration settings by using a CIM session, New-CimSession will prompt for a password:

PS C:\> $Session = New-CimSession –ComputerName "Server64" –Credential ACCOUNTS\JDoe
PS C:\> Start-DscConfiguration -Path "C:\SS64\Configurations\" -CimSession $Session

“Just like beautiful snowflakes swirling in the winter’s breath, no two were exactly alike…” ~ Alex Tatiyants (DevOps is Ruining My Craft)

Related PowerShell Cmdlets

Get-DscConfiguration - Get the current config. of a node.
Get-DscResource - Get Desired State Config. resources from a computer.
Get-DscLocalConfigurationManager - Get Local Config Manager settings.
New-DSCCheckSum - Create checksum files for DSC docs/resources.
TechNet - Desired State Configuration Overview.


 
Copyright © 1999-2024 SS64.com
Some rights reserved