你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Register-AzAutomationDscNode
Registers an Azure virtual machine running Windows OS as a DSC node for an Automation account.
Syntax
Register-AzAutomationDscNode
-AzureVMName <String>
[-NodeConfigurationName <String>]
[-ConfigurationMode <String>]
[-ConfigurationModeFrequencyMins <Int32>]
[-RefreshFrequencyMins <Int32>]
[-RebootNodeIfNeeded <Boolean>]
[-ActionAfterReboot <String>]
[-AllowModuleOverwrite <Boolean>]
[-AzureVMResourceGroup <String>]
[-AzureVMLocation <String>]
[-ResourceGroupName] <String>
[-AutomationAccountName] <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Register-AzAutomationDscNode cmdlet registers an Azure virtual machine as an APS Desired State Configuration (DSC) node in an Azure Automation account. This cmdlet will only register VMs running Windows OS as an Automation DSC Node for an account.
If you need to register a node to an automation account in a different subscription, you will need to use an ARM template rather than cmdlets. See the Azure Automation documentation for more details.
Examples
Example 1: Register an Azure virtual machine as an Azure DSC node
Register-AzAutomationDscNode -AutomationAccountName "Contoso17" -AzureVMName "VirtualMachine01" -ResourceGroupName "ResourceGroup01"-NodeConfigurationName "ContosoConfiguration.webserver"
This command registers the Azure virtual machine named VirtualMachine01 as a DSC node in the Automation account named Contoso17.
Parameters
-ActionAfterReboot
Specifies the action that the virtual machine takes after it restarts. Valid values are:
- ContinueConfiguration
- StopConfiguration
Type: | String |
Accepted values: | ContinueConfiguration, StopConfiguration |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-AllowModuleOverwrite
Specifies whether new configurations that this DSC node downloads from the Azure Automation DSC pull server replace the existing modules already on the target node.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-AutomationAccountName
Specifies the name of an Automation account in which this cmdlet registers a virtual machine.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-AzureVMLocation
The Azure VM location.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-AzureVMName
The name of the Azure virtual machine to register for management with Azure Automation DSC.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-AzureVMResourceGroup
The Azure VM resource group name.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ConfigurationMode
Specifies the DSC configuration mode. Valid values are:
- ApplyAndMonitor
- ApplyAndAutocorrect
- ApplyOnly
Type: | String |
Accepted values: | ApplyAndMonitor, ApplyAndAutocorrect, ApplyOnly |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ConfigurationModeFrequencyMins
Specifies the frequency, in minutes, at which the background application of DSC attempts to implement the current configuration on the target node.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NodeConfigurationName
Specifies the name of the node configuration that this cmdlet configures the virtual machine to pull from Azure Automation DSC.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-RebootNodeIfNeeded
Specifies whether to restart the virtual machine, if needed.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-RefreshFrequencyMins
Specifies the frequency, in minutes, at which the local Configuration Manager contacts the Azure Automation DSC pull server to download the latest node configuration.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
Specifies the name of a resource group. The Automation account with which this cmdlet registers a virtual machine belongs to the resource group that this parameter specifies.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |