„Benutzer:MovGP0/Powershell/DSC“ – Versionsunterschied

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen
Inhalt gelöscht Inhalt hinzugefügt
MovGP0 (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
MovGP0 (Diskussion | Beiträge)
Zeile 65: Zeile 65:
Get-DscConfiguration -Computername 'hostname'
Get-DscConfiguration -Computername 'hostname'
</syntaxhighlight>
</syntaxhighlight>

=== Azure ===
* {{Internetquelle
|url=http://aka.ms/thereleasepipelinemodelpdf
|titel=The Release Pipeline Model
|format=PDF
|sprache=en
|werk=MSDN
|hrsg=Microsoft Azure
|zugriff=2016-08-31
}}
* {{Internetquelle
|url=https://github.com/Azure/azure-quickstart-templates
|titel=Azure Quickstart Templates
|sprache=en
|werk=Github
|hrsg=Microsoft Azure
|zugriff=2016-08-31
}}


== Quellen ==
== Quellen ==

Version vom 31. August 2016, 20:52 Uhr

   MovGP0        Über mich        Hilfen        Artikel        Weblinks        Literatur        Zitate        Notizen        Programmierung        MSCert        Physik      

Powershell Desired State Configuration (DSC)

Überblick

  • Basiert auf offenem Standard
  • Deklarative Konfiguration
  • Ablauf
    1. Authoring: Imperative und Deklarative PS-Befehle erzeugen .MOF-Dateien
    2. Staging: Konfiguration wird für Client berechnet
    3. „Make it so“: Deklarative Konfiguration wird durch DSC-Provider umgesetzt

Vorraussetzungen

  • Powershell 4.0+
    • Windows 7 SP1+
    • Windows Server 2008 R2 SP1+
    • Linux[1]
  • Windows Management Framework 4.0+
    • Common Information Model (CIM) Namespace
      Get-CimClass -Namespace Root\Microsoft\Windows\DesiredStateConfiguration
      
    • DSC cmdlets, providers, resources
      $env:PSModulePath
      C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration
      
  • .NET Framework 4.5+
  • Achtung: Fehler in KB3176934[2]
Remoting
  • Adminstrator Cedentials
  • PowerShell Remoting enabled [3]
    Enable-PSRemoting -Force
    
  • Remote management enabled [3]
    # Admin
    Start-Service WinRM
    winrm set winrm/config/client '@{TrustedHosts="RemoteComputer1,RemoteComputer2"}'
    
  • Empfohlen
    • Domain System (easier remote management)
    • Public Key Infrastructure (PKI) for SSL and encryption

Commands

Get-Command -Module PSDesiredStateConfiguration

Deployment

  • Push-Model
    • Deployment using Start-DscConfiguration
  • Pull-Model
    • Server gets configuration from HTTP/HTTPS server or SMP file share
  • Restore previous configuration with Restore-DscConfiguration
  • Test if Server meets config with Test-DscConfiguration -Verbose
  • Originale Konfiguration ermitteln
    $session = New-CimSession -Computername 'hostname'
    Get-DscConfiguration -CimSession $session 
    #or
    Get-DscConfiguration -Computername 'hostname'
    

Azure

Quellen

  1. Eric Slesar: Get started with Desired State Configuration (DSC) for Linux. In: MSDN. Microsoft, 22. August 2016, abgerufen am 26. August 2016 (englisch).
  2. PowerShell DSC and implicit remoting broken in KB3176934. In: MSDN, Windows PowerShell Blog. Microsoft, 23. August 2016, abgerufen am 26. August 2016 (englisch).
  3. a b Chris B. Hoffman: How to Run PowerShell Commands on Remote Computers. How-To Geek, 22. Juni 2012, abgerufen am 26. August 2016 (englisch).