Register-AzureRmAutomationDscNode
將 Azure 虛擬機註冊為自動化帳戶的 DSC 節點。
警告
自 2024 年 2 月 29 日起,AzureRM PowerShell 模組已正式淘汰。 建議使用者從 AzureRM 遷移至 Az PowerShell 模組,以確保持續支援和更新。
雖然 AzureRM 模組可能仍可運作,但不再維護或支援它,但會根據用戶的判斷權和風險放置任何繼續使用。 如需轉換至 Az 模組的指引,請參閱我們的 移轉資源 。
語法
Register-AzureRmAutomationDscNode
-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
Register-AzureRmAutomationDscNode Cmdlet 會將 Azure 虛擬機註冊為 Azure 自動化 帳戶中的 APS Desired 狀態設定 (DSC) 節點。
範例
範例 1:將 Azure 虛擬機註冊為 Azure DSC 節點
PS C:\>Register-AzureRmAutomationDscNode -AutomationAccountName "Contoso17" -AzureVMName "VirtualMachine01" -ResourceGroupName "ResourceGroup01"-NodeConfigurationName "ContosoConfiguration.webserver"
此命令會將名為 VirtualMachine01 的 Azure 虛擬機註冊為名為 Contoso17 的自動化帳戶中的 DSC 節點。
參數
-ActionAfterReboot
指定虛擬機重新啟動後所採取動作。 有效值為:
- ContinueConfiguration
- StopConfiguration
類型: | String |
接受的值: | ContinueConfiguration, StopConfiguration |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-AllowModuleOverwrite
指定這個 DSC 節點是否從 Azure 自動化 DSC 提取伺服器下載的新組態取代目標節點上現有的模組。
類型: | Boolean |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-AutomationAccountName
指定這個 Cmdlet 註冊虛擬機的自動化帳戶名稱。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-AzureVMLocation
指定此 Cmdlet 註冊虛擬機的位置。 若要取得有效的位置,請使用 Get-AzureRMLocation Cmdlet。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-AzureVMName
指定此 Cmdlet 註冊管理之 Azure 虛擬機的名稱。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-AzureVMResourceGroup
指定此 Cmdlet 註冊之 Azure 虛擬機的資源群組名稱。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-ConfigurationMode
指定 DSC 組態模式。 有效值為:
- ApplyAndMonitor
- ApplyAndAutocorrect
- ApplyOnly
類型: | String |
接受的值: | ApplyAndMonitor, ApplyAndAutocorrect, ApplyOnly |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-ConfigurationModeFrequencyMins
指定 DSC 的背景應用程式嘗試在目標節點上實作目前組態的頻率,以分鐘為單位。
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶
類型: | IAzureContextContainer |
別名: | AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-NodeConfigurationName
指定此 Cmdlet 設定虛擬機從 #D74077CE432AF408DAEADB11588C961C0 DSC 提取的節點組態名稱。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-RebootNodeIfNeeded
指定是否視需要重新啟動虛擬機。
類型: | Boolean |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-RefreshFrequencyMins
指定本機 Configuration Manager 連絡 Azure 自動化 DSC 提取伺服器以下載最新節點組態的頻率,以分鐘為單位。
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-ResourceGroupName
指定資源群組的名稱。 此 Cmdlet 註冊虛擬機所屬資源群組的自動化帳戶,此參數會指定。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |