Was this page helpful?

Automatisierte Installation von Server-Rollen und -Features

    Inhaltsverzeichnis
    keine Gliederung

    In der OM Installationsanleitung werden alle Server-Rollen und -Features aufgelistet, die auf einem OM-Server installiert sein müssen, um den Operations Manager in vollem Umfang nutzen zu können. Um die Installation dieser Rollen und Features auf einem Windows Server 2008 oder 2012 automatisiert durchzuführen, muss das folgende Script in einer Powershell mit erhöhten, administrativen Rechten ausgeführt werden.

    Damit das Script erfolgreich laufen kann, ist die Installation von Powershell 4.0 notwendig.

     

    #....................................BITTE LESEN....................................................
    #@Unicat GmbH 2013 (RH)
    #Erstelldatum: 23.1.2013
    #
    #
    #WICHTIG: Damit die Ausführung von Powershell Scripten auf dem System möglich ist, muss die Execution
    #Policy auf 'unrestricted' eingestellt sein. Um den aktuellen Stand der Execution Policy herauszufinden,
    #kann das Commandlet 'Get-ExecutionPolicy' verwendet werden. Sofern die Execution Policy auf 'restricted'
    #eingestellt ist, führen Sie bitte an der Konsole folgendes Kommando aus: Set-ExecutionPolicy unrestricted.
    #Nach Installation der Serverrollen, kann der ursprüngliche Zustand der Execution Policy mit dem Commandlet
    #'Set-ExecutionPolicy' wiederhergestellt werden.
    #...................................................................................................

    #Diese Funktion überprüft die Existenz des gewünschten Features, und dessen Status. Sollte das
    #Feature bereits installiert sein, wird keine Aktion getätigt, ansonsten wird das Feature auf
    #dem System installiert.
    #

    import-module Servermanager
    $version = (Get-WmiObject -class Win32_OperatingSystem).Caption
    if ($version -like '*2012*') {
        function GET-analyzeInstallFeature_W2k12
        {
            param($FeatureName)
            $oFeature = Get-WindowsFeature $FeatureName
            #Check Object
            if (!$oFeature) {echo ("Das Feature "+ $Featurename + " konnte auf dem System nicht gefunden werden.")}
            else {
                  echo ('Das Feature ' + $oFeature.Name + ' wurde gefunden:')
                  echo $oFeature
                  if ($oFeature.Installed)
                  {
                        #Feature already installed Nothing to do
                        echo ('Das Feature ' + $oFeature.Name + ' ist bereits installiert. Keine Aktion notwendig')
                  } else {
                        #Here we call install Feature
                        echo ('Das Feature ' + $oFeature.Name + ' wird nun installiert, bitte Warten.')
                        Start-Sleep -s 4                                            
                        Install-WindowsFeature $oFeature                                         
                  }
            }
         }
    }
    else {
        function GET-analyzeInstallFeature_W2k8
        {
            param($FeatureName)
            $oFeature = Get-WindowsFeature $FeatureName
            #Check Object
            if (!$oFeature) {echo ("Das Feature "+ $Featurename + " konnte auf dem System nicht gefunden werden.")}
            else {
                  echo ('Das Feature ' + $oFeature.Name + ' wurde gefunden:')
                  echo $oFeature
                  if ($oFeature.Installed)
                  {
                        #Feature already installed Nothing to do
                        echo ('Das Feature ' + $oFeature.Name + ' ist bereits installiert. Keine Aktion notwendig')
                  } else {
                        #Here we call install Feature
                        echo ('Das Feature ' + $oFeature.Name + ' wird nun installiert, bitte Warten.')
                        Start-Sleep -s 4
                        Add-WindowsFeature $oFeature                    
                  }
            }
         }
    }


    #
    #In der folgenden Section können Sie die Features angeben, welche installiert werden sollen.
    #Der Name des Features kann mit dem Commandlet 'Get-WindowsFeature' ermittelt werden. Entnehmen
    #Sie bitte den Namen des Features aus der Spalte 'NAME'
    #
    ##################################Zu installierende Features########################################

    ###Windows Server 2012###
    if ($version -like '*2012*') {

    GET-analyzeInstallFeature_W2k12 FileAndStorage-Services
    GET-analyzeInstallFeature_W2k12 RSAT-DFS-Mgmt-Con      
    GET-analyzeInstallFeature_W2k12 File-Services                  
    GET-analyzeInstallFeature_W2k12 FS-FileServer                  
    GET-analyzeInstallFeature_W2k12 Storage-Services              
    GET-analyzeInstallFeature_W2k12 Web-Server

    GET-analyzeInstallFeature_W2k12 NET-Framework-Features         
    GET-analyzeInstallFeature_W2k12 NET-Framework-Core             
    GET-analyzeInstallFeature_W2k12 NET-Framework-45-Features       
    GET-analyzeInstallFeature_W2k12 NET-Framework-45-Core          
    GET-analyzeInstallFeature_W2k12 NET-Framework-45-ASPNET       
    GET-analyzeInstallFeature_W2k12 NET-WCF-Services45             
    GET-analyzeInstallFeature_W2k12 NET-WCF-TCP-PortSharing45     
    GET-analyzeInstallFeature_W2k12 User-Interfaces-Infra          
    GET-analyzeInstallFeature_W2k12 Server-Gui-Mgmt-Infra         
    GET-analyzeInstallFeature_W2k12 Server-Gui-Shell               
    GET-analyzeInstallFeature_W2k12 PowerShellRoot                
    GET-analyzeInstallFeature_W2k12 PowerShell-V2                 
    GET-analyzeInstallFeature_W2k12 PowerShell-ISE                 
    GET-analyzeInstallFeature_W2k12 WoW64-Support                  

    GET-analyzeInstallFeature_W2k12 Web-WebServer                 
    GET-analyzeInstallFeature_W2k12 Web-Common-Http                
    GET-analyzeInstallFeature_W2k12 Web-Default-Doc                
    GET-analyzeInstallFeature_W2k12 Web-Dir-Browsing               
    GET-analyzeInstallFeature_W2k12 Web-Http-Errors                
    GET-analyzeInstallFeature_W2k12 Web-Static-Content             
    GET-analyzeInstallFeature_W2k12 Web-Health                     
    GET-analyzeInstallFeature_W2k12 Web-Http-Logging               
    GET-analyzeInstallFeature_W2k12 Web-Performance                
    GET-analyzeInstallFeature_W2k12 Web-Stat-Compression          
    GET-analyzeInstallFeature_W2k12 Web-Security                   
    GET-analyzeInstallFeature_W2k12 Web-Filtering
    GET-analyzeInstallFeature_W2k12 Web-Basic-Auth                  
    GET-analyzeInstallFeature_W2k12 Web-Windows-Auth               
    GET-analyzeInstallFeature_W2k12 Web-App-Dev                    
    GET-analyzeInstallFeature_W2k12 Web-Net-Ext
    GET-analyzeInstallFeature_W2k12 Web-Net-Ext45                 
    GET-analyzeInstallFeature_W2k12 Web-Asp-Net
    GET-analyzeInstallFeature_W2k12 Web-Asp-Net45                    
    GET-analyzeInstallFeature_W2k12 Web-ISAPI-Ext                  
    GET-analyzeInstallFeature_W2k12 Web-ISAPI-Filter               
    GET-analyzeInstallFeature_W2k12 Web-Mgmt-Tools                 
    GET-analyzeInstallFeature_W2k12 Web-Mgmt-Console              
    GET-analyzeInstallFeature_W2k12 Web-Mgmt-Compat                
    GET-analyzeInstallFeature_W2k12 Web-Metabase                   
    GET-analyzeInstallFeature_W2k12 Web-Lgcy-Mgmt-Console         
    GET-analyzeInstallFeature_W2k12 Web-Lgcy-Scripting             
    GET-analyzeInstallFeature_W2k12 Web-WMI

    }
    ###Windows Server 2008###
    else {

    GET-analyzeInstallFeature_W2k8 File-Services
    GET-analyzeInstallFeature_W2k8 FS-FileServer
    GET-analyzeInstallFeature_W2k8 RSAT-DFS-Mgmt-Con
    GET-analyzeInstallFeature_W2k8 Web-Server
        
    GET-analyzeInstallFeature_W2k8 NET-Framework-Core               
    GET-analyzeInstallFeature_W2k8 PowerShell-ISE                 

    GET-analyzeInstallFeature_W2k8 Web-WebServer                 
    GET-analyzeInstallFeature_W2k8 Web-Common-Http                
    GET-analyzeInstallFeature_W2k8 Web-Default-Doc                
    GET-analyzeInstallFeature_W2k8 Web-Dir-Browsing               
    GET-analyzeInstallFeature_W2k8 Web-Http-Errors                
    GET-analyzeInstallFeature_W2k8 Web-Static-Content             
    GET-analyzeInstallFeature_W2k8 Web-Health                     
    GET-analyzeInstallFeature_W2k8 Web-Http-Logging               
    GET-analyzeInstallFeature_W2k8 Web-Performance                
    GET-analyzeInstallFeature_W2k8 Web-Stat-Compression          
    GET-analyzeInstallFeature_W2k8 Web-Security                   
    GET-analyzeInstallFeature_W2k8 Web-Filtering
    GET-analyzeInstallFeature_W2k8 Web-Basic-Auth                   
    GET-analyzeInstallFeature_W2k8 Web-Windows-Auth               
    GET-analyzeInstallFeature_W2k8 Web-App-Dev                    
    GET-analyzeInstallFeature_W2k8 Web-Net-Ext                   
    GET-analyzeInstallFeature_W2k8 Web-Asp-Net                    
    GET-analyzeInstallFeature_W2k8 Web-ISAPI-Ext                  
    GET-analyzeInstallFeature_W2k8 Web-ISAPI-Filter               
    GET-analyzeInstallFeature_W2k8 Web-Mgmt-Tools                 
    GET-analyzeInstallFeature_W2k8 Web-Mgmt-Console              
    GET-analyzeInstallFeature_W2k8 Web-Mgmt-Compat                
    GET-analyzeInstallFeature_W2k8 Web-Metabase                   
    GET-analyzeInstallFeature_W2k8 Web-Lgcy-Mgmt-Console         
    GET-analyzeInstallFeature_W2k8 Web-Lgcy-Scripting             
    GET-analyzeInstallFeature_W2k8 Web-WMI

    }
    ##################################Zu installierende Features########################################

    Was this page helpful?
    Tags (Schlagworte bearbeiten)

    Dateien 1

    DateiGrößeDatumAngehängt von: 
    ActivateOMFeatures_W2k8_W2k12.ps1
    PS-Script zur automatisierten Installation von Server-Rollen und Features
    8.05 kB16:05, 20 Feb 2017AdminAktionen
    Um einen Kommentar zu schreiben, müssen Sie sich anmelden.
    Unterstützt von MindTouch Core