1 / 24

Scripting mit Windows PowerShell

Scripting mit Windows PowerShell. Frank Koch Infrastructure Architect Microsoft Schweiz / Deutschland. Sie möchten mehr erfahren?. frankoch@microsoft.com Emailanfragen können dauern! http://frankoch.com Links zum Blog etc. Kostenlose PowerShell Bücher im Blog. http://frankoch.com.

garren
Télécharger la présentation

Scripting mit Windows PowerShell

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Scripting mitWindows PowerShell Frank Koch Infrastructure Architect Microsoft Schweiz / Deutschland

  2. Sie möchten mehr erfahren? • frankoch@microsoft.com • Emailanfragen können dauern! • http://frankoch.com • Links zum Blog etc.

  3. Kostenlose PowerShell Bücher im Blog http://frankoch.com

  4. Windows PowerShell • Leicht zu verwenden, erlaubt kurze Skripte • Unterstützt alte CMD oder WSH Skripte • Hohe Automatisierung inkl. .NET, WMI & COM

  5. Sicherheit ist sehr wichtig • Standardmässig werden keine Skripte ausgeführt, nur interaktive Nutzung! • Ändern Sie die ExecutionPolicy, z.B. über Gruppenrichtlinien • Klick auf PS1 Skript öffnet nur Notepad

  6. Windows PowerShell Grundlagen • Neue Shell für Windows für Skripte & interaktive Nutzung • Basiert auf .NET aber man muss nicht .NET kennen oder C# lernen • Viele eingebaute Tools & Befehle (+120) • Alte Tools funktionieren weiterhin und können kombiniert werden (md, ipconfig, wmic…) • Vollkommen Objektorientiert statt Texte analysieren (ipconfig & IPv6!) • Grundlage für neues Managementframework

  7. MMC 3.0 über Windows PowerShell Windows Forms GUI Microsoft Management Console 3.0 PSObject Early Bound Objects Layered Over Command Line Windows PowerShell Cmdlets Windows PowerShell Engine To Manage Your Application Custom Application

  8. Beispiel Exchange 2007 GUI CLI Setup WinForms WinForms ADO.Net Early-bound objs PowerShellData Provider PowerShellEngine Exchange cmdlets Configuration Data Access Process boundary MAPI Store AD Meta base Registry

  9. FolgendeProduktebenutzen PowerShell • Exchange Server 2007 • SC Virtual Machine Manager • SC Data Protection Manager • SC Operations Manager • SC Configuration Manager Client Tools • Windows Computer Cluster 2008 • Windows Server 2008 • Add-on für Windows Server 2003, XP, Vista • Common Engineering Criteria 2009

  10. Grundlagen

  11. Sprachgrundlagen von PowerShell • Syntax: verb-noun –parameter arguments • ImmerEinzahl, Parameters startenmit “-” • Get-help, get-help * • Get-help get-process • WichtigeBefehlefür den Anfang: • Get-help, get-command • Get-member • Measure-object | = AltGr 7 und nicht AltGr 1 (=¦) -detailed

  12. Für den Anfang: Bekanntesexistiertweiter • PowerShell kennt Unix & CMD Befehle • Dir = LS = get-childitem • Ps = get-process • “Alte” Befehlealsaliasabgelegt • ErweiterbarnacheigenenWünschen • VergessenSienicht was Siewissen! • ErweiternSie die Befehlenurfür die direkteEingabe, nichtfürIhreSkripte! • SonstkönnenSie die Skriptenichtweitergeben

  13. Viele Partner erweitern die PowerShell • Active Directory Management mit Quest • FürBenutzer, Gruppen… • Kostenlos & regelmässigerweitert • Gruppenrichtlinienmit SDM Software • Anlegen, Löschen & Zuweisen von GPOs • Anpassen von GPOs (kostenpflichtig) • Navigierendurch das AD wiedurcheinDateisystemmit PSCX • Vieleweiterehilfreichebefehle (zip, Ping…)

  14. Es exitieren auch sinnvolle Zusatztools • PowerGadgetsalsgrafischeAusgabetool • InteraktiveBedienungoderreines Reporting • PowerShell Plus • Editor mit Intellisense und Debugger • Peedy • Dazu später mehr 

  15. Einstieg Übersicht, Hilfe & Befehle

  16. Objekte 1 Variablen & Umgebung

  17. Einfaches Sortieren & Selektieren

  18. Objekte 2 WMI, .NET und COM

  19. Praxis: AD User & mehr

  20. Ausgabe CSV, XML, TXT, PDF…

  21. Buntes Powergadgets & mehr

  22. Wie geht es weiter mit der PowerShell? • Version 1 ist Bestandteil der Plattform • Ab Windows 2008 direkt dabei • Viele Produkte benutzen Windows PowerShell • Version 2 ist in früher Beta-Phase • Remoting ist „wichtigste“ Neuerung • Beta verlangt noch Uninstall von V1 • RTM wird Upgrade erlauben • Noch viele Änderungen möglich!!! Geben Sie Feedback !!

  23. Wichtige Ressourcen • Kostenlose Windows PowerShell Bücher & Workshops & Webcasts auf unserem Blog • http://frankoch.com • http://blogs.msdn.com/powershell • Sehr gute Bücher bei MS Press und anderen Verlagen, z.B. von Bruce Payette • Vergessen Sie nicht die Dokumentation!

  24. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related