Skip to content

Instantly share code, notes, and snippets.

@infernalsirius
Last active July 8, 2016 21:36
Show Gist options
  • Save infernalsirius/77c9494d381bf6934b0a388349570976 to your computer and use it in GitHub Desktop.
Save infernalsirius/77c9494d381bf6934b0a388349570976 to your computer and use it in GitHub Desktop.
Boxstarter provision script for windows server
#The Boxstarter Killer Feature: Handling Reboots!!!
# Enable Big-Kid Mode
#Disables UAC. Note that Windows 8 and 8.1 can not launch Windows Store applications with UAC disabled.
Disable-UAC
Update-ExecutionPolicy -Policy Unrestricted
# Disable Password Expiration
Write-BoxstarterMessage "Disabing password expiration..."
wmic useraccount where "name='$([Environment]::UserName)'" set PasswordExpires=FALSE
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
# Enable RDP
Enable-RemoteDesktop
Write-BoxstarterMessage "Opening firewall for RDP..."
Set-NetFirewallRule -Name RemoteDesktop-UserMode-In-TCP -Enabled True
# Update Windows
Enable-MicrosoftUpdate
Install-WindowsUpdate -AcceptEula
# Turns off IE Enhansed Security Configuration that is on by defaulton Server OS versions
Disable-InternetExplorerESC
# Disable Hibernation
Write-BoxstarterMessage "Disabing hibernation..."
reg ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f
reg ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f
# troubleshooting tools
cinst fiddler4
# developer tools
cinst atom
cinst notepadplusplus
cinst SublimeText3
cinst sublimetext3-contextmenu
cinst poshgit
cinst dotpeek
cinst mssql2014express-defaultinstance
cinst git
# Install Atom Packages
apm install autocomplete-modules
apm install json-schema
apm install jsonlint
apm install language-aspx
apm install language-powershell
apm install linter
apm install linter-jshint
apm install linter-xmllint
# enable windows server features
# Enable Internet Information Services Feature - will enable a bunch of things by default
choco install IIS-WebServerRole --source windowsfeatures --limitoutput
# Web Management Tools Features
choco install IIS-ManagementScriptingTools --source windowsfeatures --limitoutput
choco install IIS-IIS6ManagementCompatibility --source windowsfeatures --limitoutput # installs IIS Metbase
# Common Http Features
choco install IIS-HttpRedirect --source windowsfeatures --limitoutput
# .NET Framework 4.5/4.6 Advance Services
choco install NetFx4Extended-ASPNET45 --source windowsfeatures --limitoutput # installs ASP.NET 4.5/4.6
# Application Development Features
choco install IIS-NetFxExtensibility45 --source windowsfeatures --limitoutput # installs .NET Extensibility 4.5/4.6
choco install IIS-ISAPIFilter --source windowsfeatures --limitoutput # required by IIS-ASPNET45
choco install IIS-ISAPIExtensions --source windowsfeatures --limitoutput # required by IIS-ASPNET45
choco install IIS-ASPNET45 --source windowsfeatures --limitoutput # installs support for ASP.NET 4.5/4.6
choco install IIS-ApplicationInit --source windowsfeatures --limitoutput
# Health And Diagnostics Features
choco install IIS-LoggingLibraries --source windowsfeatures --limitoutput # installs Logging Tools
choco install IIS-RequestMonitor --source windowsfeatures --limitoutput
choco install IIS-HttpTracing --source windowsfeatures --limitoutput
choco install IIS-CustomLogging --source windowsfeatures --limitoutput
# Performance Features
choco install IIS-HttpCompressionDynamic --source windowsfeatures --limitoutput
# Security Features
choco install IIS-BasicAuthentication --source windowsfeatures --limitoutput
# Diable HTTP Firewall
Write-BoxstarterMessage "Opening firewall for IIS..."
Set-NetFirewallRule -Name IIS-WebServerRole-HTTP-In-TCP -RemoteAddress Any
Set-NetFirewallRule -Name IIS-WebServerRole-HTTPS-In-TCP -RemoteAddress Any
# web browsers
cinst Firefox
cinst GoogleChrome
# .Net dependencies
cinst DotNet4.5
# librairies
cinst nodejs.install
cinst python
# utilities
cinst 7zip.install
cinst sysinternals
cinst Microsoft-Hyper-V-All -source windowsFeatures
cinst IIS-WebServerRole -source windowsfeatures
# we update all software installed by boxstarter
cup
# windows customizations
Install-ChocolateyPinnedTaskBarItem "$env:windir\system32\mstsc.exe"
Install-ChocolateyPinnedTaskBarItem "$env:programfiles\console\console.exe"
Write-BoxstarterMessage "At long last... we are done..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment