@@ -192,36 +192,34 @@ $resourceGroupName = " RESOURCE GROUP NAME HERE "
192
192
$machineName = "MACHINE NAME HERE "
193
193
194
194
# Enable Antimalware with default policies
195
- $settingString = ‘ {"AntimalwareEnabled": true}’;
195
+ $setting = @ {"AntimalwareEnabled"=$ true}
196
196
# Enable Antimalware with custom policies
197
- # $settingString = ‘{
198
- # "AntimalwareEnabled": true,
199
- # "RealtimeProtectionEnabled": true,
200
- # "ScheduledScanSettings": {
201
- # "isEnabled": true,
202
- # "day": 0,
203
- # "time": 120,
204
- # "scanType": "Quick"
205
- # },
206
- # "Exclusions": {
207
- # "Extensions": ".ext1,.ext2",
208
- # "Paths":"",
209
- # "Processes":"sampl1e1.exe, sample2.exe"
210
- # },
211
- # "SignatureUpdates": {
212
- # "FileSharesSources": “”,
213
- # "FallbackOrder”: “”,
214
- # "ScheduleDay": 0,
215
- # "UpdateInterval": 0,
216
- # },
217
- # "CloudProtection": true
218
- #
219
- # }’;
220
-
197
+ $setting2 = @{
198
+ "AntimalwareEnabled"=$true;
199
+ "RealtimeProtectionEnabled"=$true;
200
+ "ScheduledScanSettings"= @{
201
+ "isEnabled"=$true;
202
+ "day"=0;
203
+ "time"=120;
204
+ "scanType"="Quick"
205
+ };
206
+ "Exclusions"= @{
207
+ "Extensions"=".ext1, .ext2";
208
+ "Paths"="";
209
+ "Processes"="sampl1e1.exe, sample2.exe"
210
+ };
211
+ "SignatureUpdates"= @{
212
+ "FileSharesSources"=“”;
213
+ "FallbackOrder”=“”;
214
+ "ScheduleDay"=0;
215
+ "UpdateInterval"=0;
216
+ };
217
+ "CloudProtection"=$true
218
+ }
221
219
# Will be prompted to login
222
220
Connect-AzAccount
223
221
# Enable Antimalware with the policies
224
- New-AzConnectedMachineExtension -Name "IaaSAntimalware" -ResourceGroupName $resourceGroupName -MachineName $machineName -Location $location -SubscriptionId $subscriptionid -Publisher “Microsoft.Azure.Security” -Settings $settingString -ExtensionType “IaaSAntimalware”
222
+ New-AzConnectedMachineExtension -Name "IaaSAntimalware" -ResourceGroupName $resourceGroupName -MachineName $machineName -Location $location -SubscriptionId $subscriptionid -Publisher “Microsoft.Azure.Security” -Settings $setting -ExtensionType “IaaSAntimalware”
225
223
```
226
224
227
225
## Next steps
0 commit comments