ビュー:

Active Directoryグループポリシー管理コンソールを使用してエージェントインストーラをインストールするためのサンプルPowerShellスクリプトです。

必要に応じて、コード内の変数を環境に合わせて変更します。$logpathlocal ,$uncPath 、および$localPath
高い特権のアカウントを使用することによるセキュリティ上の懸念を避けるため、スクリプトの実行にはシステムを使用する必要があります。
$logpathlocal="C:\temp\V1ES\Logs" #Specify a path users have enough permission to write to.
Start-Transcript -Path $logpathlocal -Append
$service = Get-Service -Name tmlisten,ntrtscan,amsp,ds_agent -ErrorAction SilentlyContinue
if ($service -eq $null) {
    $uncPath = "\\TrendMicro_Demo_VS\V1ES_client\V1ES" #Specify the UNC location of the unzipped agent installation files
    $localPath = "C:\temp\" #The location to copy the installation files to on the target endpoint 
    $installerFileName = "EndpointBasecamp.exe"

    Copy-Item -Path $uncPath -Destination $localPath -Recurse -Force
    while ((Get-ChildItem $localPath).Count -lt (Get-ChildItem $uncPath).Count) {
        Start-Sleep -Seconds 1
    }
    Write-host "File copy completed, start to install progress" 
    $localInstallerPath = Join-Path $localPath $installerFileName
    Start-Process -Wait -FilePath $localInstallerPath -ArgumentList '/s /v/qn' -PassThru
} else {
    Write-host "The services already existed, skip the installation." 
}
Stop-Transcript