@@ -32,18 +32,25 @@ To enable a VM extension on your Azure Arc-enabled server, use [New-AzConnectedM
32
32
The following example enables the Log Analytics VM extension on a Azure Arc-enabled Linux server:
33
33
34
34
``` powershell
35
- PS C:\> $Setting = @{ "workspaceId" = "workspaceId" }
36
- PS C:\> $protectedSetting = @{ "workspaceKey" = "workspaceKey" }
37
- PS C:\> New-AzConnectedMachineExtension -Name OMSLinuxAgent -ResourceGroupName "myResourceGroup" -MachineName "myMachine" -Location "eastus " -Publisher "Microsoft.EnterpriseCloud.Monitoring" -Settings $Setting -ProtectedSetting $protectedSetting -ExtensionType "OmsAgentForLinux"
35
+ $Setting = @{ "workspaceId" = "workspaceId" }
36
+ $protectedSetting = @{ "workspaceKey" = "workspaceKey" }
37
+ New-AzConnectedMachineExtension -Name OMSLinuxAgent -ResourceGroupName "myResourceGroup" -MachineName "myMachine" -Location "regionName " -Publisher "Microsoft.EnterpriseCloud.Monitoring" -Settings $Setting -ProtectedSetting $protectedSetting -ExtensionType "OmsAgentForLinux"
38
38
```
39
39
40
40
To enable the Log Analytics VM extension on an Azure Arc-enabled Windows server, change the value for the ` -ExtensionType ` parameter to ` "MicrosoftMonitoringAgent" ` in the previous example.
41
41
42
42
The following example enables the Custom Script Extension on an Azure Arc-enabled server:
43
43
44
44
``` powershell
45
- PS C:\> $Setting = @{ "commandToExecute" = "powershell.exe -c Get-Process" }
46
- PS C:\> New-AzConnectedMachineExtension -Name custom -ResourceGroupName myResourceGroup -MachineName myMachineName -Location eastus -Publisher "Microsoft.Compute" -Settings $Setting -ExtensionType CustomScriptExtension
45
+ $Setting = @{ "commandToExecute" = "powershell.exe -c Get-Process" }
46
+ New-AzConnectedMachineExtension -Name "custom" -ResourceGroupName "myResourceGroup" -MachineName "myMachineName" -Location "regionName" -Publisher "Microsoft.Compute" -Settings $Setting -ExtensionType CustomScriptExtension
47
+ ```
48
+
49
+ The following example enables the Microsoft Antimalware extension on an Azure Arc-enabled Windows server:
50
+
51
+ ``` powershell
52
+ $Setting = @{ "AntimalwareEnabled" = $true }
53
+ New-AzConnectedMachineExtension -Name "IaaSAntimalware" -ResourceGroupName "myResourceGroup" -MachineName "myMachine" -Location "regionName" -Publisher "Microsoft.Azure.Security" -Settings $Setting -ExtensionType "IaaSAntimalware"
47
54
```
48
55
49
56
### Key Vault VM extension
0 commit comments