OpsaC - Operating as PowerShell code
published: November 30, 2014 author: Tinu tags: Features - Windows Server categories: Windows Server
Get-WindowsFeature | Where-Object {$_.Name -like “Backup*”}
Get-WindowsFeature | Where-Object {$_.Name -like “Desktop*” -or $_.Name -like “Web-DAV*”}
Get-WindowsFeature | Where InstallState -like installed
Windows Server Update Services (WSUS) is not configurable as a recovery source for Features on Demand! If you wanted to install some feature like NetFx3 (.NET Framework 3.5), that feature is not included in any edition and is therefore not in the wim at all!
Computer Configuration, Administrative Templates, System, Specify settings for optional component installation and component repair oder wenn da nicht gefunden, dann über All Settings…
if (Test-Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Servicing"){
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Servicing
}
Enables use of Windows Update as an installation source, this is the default if nothing is configured. LocalSourcePathSpecifies location to use for installation source. Can specify more than one source when separated with a ‘;’. Valid sources include a network folder path or a WIM file (using the syntax wim:<path to wim>:<index>) LocalSourcePath, REG_EXPAND_SZ, “wim:c:\install.wim:2” RepairContentServerSourceValue 2 will contact Windows Update directly to download repair content instead of Windows Server Update Services (WSUS). UseWindowsUpdateValue 2 will prevent the installation from attempting to contact Windows Update/WSUS Servers. UseWindowsUpdate, REG_DWORD, 2
DISM /online /enable-feature /featurename:WindowsServerBackup /source:wim:c:\install.wim:2 /limitaccess The limitaccess switch will prevent the installation from attempting to contact Windows Update/WSUS Servers.
1 = Server Standard Core 2 = Server Standard GUI 3 = Server Datacenter Core 4 = Server Datacenter GUI
Voraussetzungen: ISO an Server anhängen Index suchen
dism /get-wiminfo /wimfile:D:\sources\install.wim
Details for image : D:\sources\install.wim
Index : 2
Name : Windows Server 2012 R2 SERVERSTANDARD
Description : Windows Server 2012 R2 SERVERSTANDARD
Size : 11 676 579 164 bytes
WimFile mounten
dism /mount-wim /wimfile:D:/sources/install.wim /index:2 /mountdir:C:/mountdir /ReadOnly
Mounting image
[==========================100.0%==========================]
The operation completed successfully.
WimFile unmounten
dism /unmount-wim /mountdir:C:/mountdir /discard
Windows Feature .NET Framework 3.5 installieren
Dism /online /enable-feature /featurename:NetFx3 /All /Source:D:\sources\sxs /LimitAccess
Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.
Windows Feature .NET Environment 3.5 (für Asp .Net) installieren
Dism /online /enable-feature /featurename:WAS-NetFxEnvironment /All /Source:D:\sources\sxs /LimitAccess
Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.
Install-WindowsFeature Web-Server -IncludeAllSubFeature -Source D:\sourses\sxs