Powershell Script to Install Requirements for Skype for Business Server 2015 on Server 2012 R2

Download Hotfix & Install KB2982006

Install Prerequisites Skype for Busines Script created by Ward Vissers www.wardvissers.nl


THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISKOF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER 
This scripts needs unrestricted access (Set-ExecutionPolicy Unrestricted.'

The prereq setup for Skype for Business is Only for Server 2012 R2

The prereq setup for Skype for Business takes around 5 minutes depending on your internet speed

PowerShell
Edit|Remove
Start-Transcript -Path c:\Skyp4B.log -noclobber 
 
# This scripts needs unrestricted access 
 
 
Write-Host "Install Prerequisites Skype for Busines Script created by Ward Vissers" -Fore Green 
Write-Host "www.wardvissers.nl" -Fore Green 
Write-Host "" 
Write-Host "THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK" -Fore Green 
Write-Host "OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER " -Fore Green 
Write-Host "" 
Write-Host "This scripts needs unrestricted access (Set-ExecutionPolicy Unrestricted.)" -ForegroundColor Green 
Write-Host "The prereq setup for Skype for Business is Only for Server 2012 R2" -ForegroundColor Green 
Write-Host "The prereq setup for Skype for Business takes around 5 minutes depending on your internet speed" -ForegroundColor Green 
 
# Setting the variables. 
$dir = 'C:\Hotfixes' 
 
 
#Check if folder exists, if not, create it 
if (Test-Path $dir){ 
Write-Host "The folder $dir exists." 
} else{ 
Write-Host "The folder $dir does not exist, creating..." -NoNewline 
New-Item $dir -type directory | Out-Null 
Write-Host "done!" -ForegroundColor Green 
} 
 
 
# Download Hotfix File 
 
$webclient = New-Object System.Net.WebClient 
$url = "http://hotfixv4.microsoft.com/Windows 8.1/Windows Server 2012 R2/sp1/Fix514814/9600/free/478232_intl_x64_zip.exe" 
$file = "$dir\478232_intl_x64_zip.exe" 
$webclient.DownloadFile($url,$file) 
 
#Extract ZIP 
Add-Type -assembly "system.io.compression.filesystem" 
[io.compression.zipfile]::ExtractToDirectory($file$dir) 
 
# Install Hotfix 
Get-Item $dir\* | foreach {WUSA ""$_.FullName /quiet /norestart"";while(get-process wusa){Write-Host "Installing $_.Name"}} 
 
# Install Features 
Add-WindowsFeature NET-Framework-Core, RSAT-ADDS, Windows-Identity-Foundation, Web-Static-Content, Web-Default-Doc, Web-Http-Errors, Web-Asp-Net, Web-Net-Ext, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Http-Logging, Web-Log-Libraries, Web-Request-Monitor, Web-Http-Tracing, Web-Basic-Auth, Web-Windows-Auth, Web-Client-Auth, Web-Filtering, Web-Stat-Compression, Web-Dyn-Compression, NET-WCF-HTTP-Activation45, Web-Asp-Net45, Web-Mgmt-Tools, Web-Scripting-Tools, Server-Media-Foundation -Restart