Skip to content

Instantly share code, notes, and snippets.

@fortyfivan
Last active March 22, 2018 21:15
Show Gist options
  • Save fortyfivan/ac8ef6ea09a7ce691fee9dd307ab77ac to your computer and use it in GitHub Desktop.
Save fortyfivan/ac8ef6ea09a7ce691fee9dd307ab77ac to your computer and use it in GitHub Desktop.
EC2 user data script for enrolling a Windows server to ScaleFT
<powershell>
# Write the Enrollment Token
$enrollment_token = "ENROLLMENT_TOKEN"
$enrollment_token_path = "C:\windows\system32\config\systemprofile\AppData\Local\ScaleFT\enrollment.token"
New-Item -ItemType directory -Path (Split-Path $enrollment_token_path -Parent)
$enrollment_token | Out-File $enrollment_token_path -Encoding "ASCII"
# Install ScaleFT Server Tools
$installer_url = "https://dist.scaleft.com/server-tools/windows/latest/ScaleFT-Server-Tools-latest.msi"
$installer_path = [System.IO.Path]::ChangeExtension([System.IO.Path]::GetTempFileName(), ".msi")
(New-Object System.Net.WebClient).DownloadFile($installer_url, $installer_path)
msiexec.exe /qb /I $installer_path
</powershell>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment