Skip to main content

Posts

Showing posts from January, 2016

INSTALL IIS USING POWERSHELL SCRIPT

# -------------------------------------------------------------------- # Checking Execution Policy # -------------------------------------------------------------------- #$Policy = "Unrestricted" $Policy = "RemoteSigned" If ((get-ExecutionPolicy) -ne $Policy) {   Write-Host "Script Execution is disabled. Enabling it now"   Set-ExecutionPolicy $Policy -Force   Write-Host "Please Re-Run this script in a new powershell enviroment"   Exit } # -------------------------------------------------------------------- # Loading Feature Installation Modules # -------------------------------------------------------------------- Import-Module ServerManager # -------------------------------------------------------------------- # Installing IIS # -------------------------------------------------------------------- Add-WindowsFeature -Name web-server,Web-Common-Http,Web-Asp-Net,Web-Net-Ext,Web-Net-Ext45,Web-ASP,Web-Asp-Net,Web-Asp-Net45,Web-IS

INSTALL DOT NET FRAMEWORK ON MULTIPLE SERVERS USING POWERSHELL SCRIPT

Installing .Net 4.5.2 $servers = Array of Servers foreach($server in $servers) { Write-Host “Copying the installation file” copy-item  –path “-SOURCE” –destination “ destination ” Write-Host “Installing .NET 4.5.2” Invoke-Command –Computername $server –Credentials xxxx { C:\Temp\ NET 4.5.2  /passive /norestart }