2016年4月21日木曜日

リソースマネージャモデルでデプロイした仮想マシンに Microsoft Antimalware(System center endpoint protection)をインストールする PowerShell スクリプト

location /resourceGroupName / vmName を該当のVMに変更して実行。

 

$location = "Japan East"
$resourceGroupName = "RESOURCE GROUP NAME HERE"
$vmName = "VM NAME HERE"

$settingString = ‘{ "AntimalwareEnabled": true}';
$allVersions= (Get-AzureRmVMExtensionImage -Location $location -PublisherName "Microsoft.Azure.Security" -Type "IaaSAntimalware").Version
$versionString = $allVersions[($allVersions.count)-1].Split(".")[0] + "." + $allVersions[($allVersions.count)-1].Split(".")[1]

Set-AzureRmVMExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name "IaaSAntimalware" -Publisher "Microsoft.Azure.Security" -ExtensionType "IaaSAntimalware" -TypeHandlerVersion $versionString -SettingString $settingString -Location $location

0 件のコメント:

コメントを投稿