#https://technet.microsoft.com/de-de/library/cc262243(v=office.16).aspx
#https://technet.microsoft.com/de-de/library/cc262485(v=office.16).aspx#section4
#https://www.microsoft.com/de-de/download/confirmation.aspx?id=51493
#https://www.microsoft.com/en-us/download/details.aspx?id=51492
#https://www.microsoft.com/de-de/evalcenter/evaluate-sql-server-2016
#http://www.luisevalencia.com/2016/09/25/installing-sharepoint-server-2016-with-powershell/
https://www.youtube.com/watch?v=pF9iEDPe4rg&list=PLcnT0JqQtWqOJsQE_ox3RdbZDuLUpLE7j
ipconfig /all
Get-NetIPInterface | ft Name, ifIndex, Dhcp
Set-NetIPInterface -InterfaceAlias Ethernet -Dhcp Disabled
New-NetIPAddress -InterfaceAlias Ethernet -IPAddress 10.3.3.1 -DefaultGateway 10.0.3.1 -PrefixLength 8
Set-DNSClientServerAddress -InterfaceAlias Ethernet -ServerAddresses 10.1.3.1
ipconfig /all
Get-NetIPInterface | ft Name, ifIndex, Dhcp
###
$User = „digi\administrator“
$Secure = Read-Host -AsSecureString
$cred = New-Object System.Management.Automation.PsCredential($User,$Secure)
Add-Computer -DomainName „digi.tal“ -Credential $cred
###
$var_OU = „SharePoint“
$var_DL = „digi“
$var_DR = „tal“
Import-Module ActiveDirectory
New-ADOrganizationalUnit -path „dc=$var_DL, dc=$var_DR“ -name $var_OU
$Secure = Read-Host -AsSecureString
New-ADUser -Path „OU=$var_OU,DC=$var_DL,DC=$var_DR“ -Name „sp_Admin“ -AccountPassword $Secure -Description „SharePoint Setup Account“ -ChangePasswordAtLogon:$False -CannotChangePassword:$False -PasswordNeverExpires:$False -Enabled:$True
$Secure = Read-Host -AsSecureString
New-ADUser -Path „OU=$var_OU,DC=$var_DL,DC=$var_DR“ -Name „sql_SvcAcc“ -AccountPassword $Secure -Description „SQL Server Benutzer Account“ -ChangePasswordAtLogon:$False -CannotChangePassword:$False -PasswordNeverExpires:$False -Enabled:$True
$Secure = Read-Host -AsSecureString
New-ADUser -Path „OU=$var_OU,DC=$var_DL,DC=$var_DR“ -Name „sp_FarmAcc“ -AccountPassword $Secure -Description „SharePoint Farm Account“ -ChangePasswordAtLogon:$False -CannotChangePassword:$False -PasswordNeverExpires:$False -Enabled:$True
$Secure = Read-Host -AsSecureString
New-ADUser -Path „OU=$var_OU,DC=$var_DL,DC=$var_DR“ -Name „sp_AppPool“ -AccountPassword $Secure -Description „SharePoint Application Pool Account“ -ChangePasswordAtLogon:$False -CannotChangePassword:$False -PasswordNeverExpires:$False -Enabled:$True
$Secure = Read-Host -AsSecureString
New-ADUser -Path „OU=$var_OU,DC=$var_DL,DC=$var_DR“ -Name „sp_AgtSvc“ -AccountPassword $Secure -Description „Gibt das Kennwort für das SQL Server-Agent-Dienstkonto an.“ -ChangePasswordAtLogon:$False -CannotChangePassword:$False -PasswordNeverExpires:$False -Enabled:$True
Get-ADGroupMember -Identity Administratoren
Add-ADGroupMember -Identity Administratoren -Members sp_Admin
Get-ADGroupMember -Identity Administratoren
###
Write-Host „Windows Server wird konfiguriert. Die notwendigen Windows-Features werden installiert.“
Import-Module Servermanager
Write-Host „‚.NET Framework Feature‘ wird installiert…“
get-windowsfeature|where{$_.name -eq „NET-Framework-Core“}|install-windowsfeature –Source d:\sources\sxs
get-windowsfeature|where{$_.name -eq „NET-HTTP-Activation“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „NET-Non-HTTP-Activ“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „NET-WCF-HTTP-Activation45“}|install-windowsfeature
Write-Host „‚Application Server role‘ wird installiert…“
get-windowsfeature|where{$_.name -eq „AS-AppServer-Foundation“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „AS-Web-Support“}|install-windowsfeature
#get-windowsfeature|where{$_.name -eq „AS-TCP-Port-Sharing“}|install-windowsfeature
#get-windowsfeature|where{$_.name -eq „AS-WAS-Support“}|install-windowsfeature
#get-windowsfeature|where{$_.name -eq „AS-HTTP-Activation“}|install-windowsfeature
#get-windowsfeature|where{$_.name -eq „AS-Named-Pipes“}|install-windowsfeature
#get-windowsfeature|where{$_.name -eq „AS-TCP-Activation“}|install-windowsfeature
Write-Host „‚Web Server role‘ wird installiert…“
get-windowsfeature|where{$_.name -eq „Web-Static-Content“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Default-Doc“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Dir-Browsing“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Http-Errors“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Http-Redirect“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-App-Dev“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Asp-Net45“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Net-Ext“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Net-Ext45“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-ISAPI-Ext“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-ISAPI-Filter“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Http-Logging“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Log-Libraries“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Request-Monitor“}|install-windowsfeature
#get-windowsfeature|where{$_.name -eq „Web-Http-Tracing“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Stat-Compression“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Dyn-Compression“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Filtering“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Basic-Auth“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Windows-Auth“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Digest-Auth“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Client-Auth“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Cert-Auth“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Url-Auth“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-IP-Security“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Mgmt-Tools“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Mgmt-Console“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Mgmt-Compat“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Metabase“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Lgcy-Mgmt-Console“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Lgcy-Scripting“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-WMI“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „Web-Scripting-Tools“}|install-windowsfeature
Write-Host „‚WAS Feature‘ wird installiert…“
get-windowsfeature|where{$_.name -eq „WAS-Process-Model“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „WAS-NET-Environment“}|install-windowsfeature
get-windowsfeature|where{$_.name -eq „WAS-Config-APIs“}|install-windowsfeature
Write-Host „‚Windows Identity Foundation Feature‘ wird installiert…“
get-windowsfeature|where{$_.name -eq „Windows-Identity-Foundation“}|install-windowsfeature
###
Write-Host „‚Module Servermanager‘ wird importiert…“
Import-Module Servermanager
Write-Host „‚SQL Server‘ wird installiert…“
$mountResult = Mount-DiskImage -ImagePath „C:\ISOs\SQLServer2016SP2-FullSlipstream-x64-DEU.iso“ -PassThru
$mountResult | Get-Volume
$driveLetter = (($mountResult | Get-Volume).DriveLetter) + „:\“
#
cd $driveLetter
./setup.exe /qs /CONFIGURATIONFILE=“C:\ISOs\SQL2016_Installationsoptionen.ini“ /IACCEPTSQLSERVERLICENSETERMS /FILESTREAMLEVEL=1
notepad
###
###;SQL SERVER 2016 Konfigurationsdatei
###
###[OPTIONS]
###
###ACTION=“Install“
###
###FEATURES=SQLEngine,FullText
###INSTANCENAME=SQL2016
###SQLSVCACCOUNT=“digi\sql_SvcAcc“
###SQLSVCPASSWORD=“SQL-Pa$$w0rd“
###AGTSVCACCOUNT=“digi\sp_AgtSvc“
###SQLSYSADMINACCOUNTS=“digi\sp_Admin“
###