SUNGARD SUMMIT 2007 sungardsummit.com 1. Microsoft PowerShell. Presented by: Jeff Modzel. March 22, 2007 Course ID 453. A Community of Learning



Similar documents
WolfTech Active Directory: PowerShell

Windows PowerShell Fundamentals

Microsoft. Jump Start. M3: Managing Windows Server 2012 by Using Windows PowerShell 3.0

Acknowledgments Finding Your Way Around Windows PowerShell p. 1 Getting Started with Windows PowerShell p. 3 Installing Windows PowerShell p.

PowerShell for Exchange Admins

POWERSHELL (& SHAREPOINT) This ain t your momma s command line!

Exploring PowerShell. Using Windows PowerShell

Microsoft Windows PowerShell v2 For Administrators

Introduction to PowerShell by Guy Thomas

Windows PowerShell. 3.0 Step by Step. Ed Wilson

Powershell Management for Defender

Lab Answer Key for Module 1: Installing and Configuring Windows Server Table of Contents Lab 1: Configuring Windows Server

Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

Lab Sample Solutions. Chapter 3

Things I wish I d known when I started using PowerShell

POWERSHELL FOR NEWBIES Getting started with PowerShell 4.0. Jeffery Hicks

Note: The scripts in this article should work for XenApp 6 and XenApp 5 for Windows Server 2008 and XenApp 5 for Windows Server 2003.

ActiveRoles Management Shell for Active Directory

You Should Be Using PowerShell Aaron Kaiser Senior Technology Support Specialist Parkway School District

5/13/2009. Dejan Foro Speaker

Windows PowerShell Cookbook

Windows Server 2008 R2: Server Management and PowerShell V2

Luminis to Banner Single Sign-On

ICT dag 03/12 Managing Systems with PowerShell. Bart Portier docent TW KHK Geel Microsoft Certified Trainer

PowerShell for Dummies

Windows PowerShell Essentials

Active Directory Account Provisioning (ADAP)

Crystal Report tips and Techniques

Intel vpro Technology Module for Microsoft* Windows PowerShell*

PowerCAMPUS Portal and Active Directory

Automating Microsoft

HIGHER EDUCATION. What can we help you achieve? SunGard Banner Financial Aid

PeopleAdmin and Banner HR Interface

Wireshark Developer and User Conference

WHITE PAPER POWERSHELL FOR DUMMIES HOW TO KEEP TRACK OF

Georgia Tech s Luminis IV Beta Testing

Administration Guide. . All right reserved. For more information about Specops Gpupdate and other Specops products, visit

INSTALLING MICROSOFT SQL SERVER AND CONFIGURING REPORTING SERVICES

Hands-On Lab. Lab 01: Getting Started with SharePoint Lab version: Last updated: 2/23/2011

Using Windows PowerShell to Manage SharePoint 2010

Virtual Printing Solutions with View in Horizon 6

CONFIGURING MICROSOFT SQL SERVER REPORTING SERVICES

Not Just for Scheduling: Doing More with SAS Enterprise Guide Automation Chris Hemedinger, SAS Institute Inc, Cary, NC

Banner Training and Help Desk Plan

Tips and Tricks Guide tm. Windows Administration. Don Jones and Dan Sullivan

Forefront Management Shell PowerShell Management of Forefront Server Products

How To Use Powerpoint In Windows Powerpoint (Windows Powerpoint)

Scoring Big with Automated Payroll Deductions

Going Through Withdrawals at WSU Presented by: Bhavani Koneru and Scott Owczarek Wayne State University March 20, 2007 Course ID: 282

Automating. Administration. Microsoft SharePoint with Windows. PowerShell 2.0. Gary Lapointe Shannon Bray. Wiley Publishing, Inc.

Microsoft Corporation. Status: Preliminary documentation

Click Studios. Passwordstate. Password Discovery, Reset and Validation. Requirements

Load Testing your Banner Systems

Troubleshoot Using Event Log Mining

A layman s guide to PowerShell 2.0 remoting. Ravikanth Chaganti

Windows PowerShell 2.0

How to Prepare for the Upgrade to Microsoft Dynamics CRM 2013 (On-premises)

Web Services Integration Case Study - Housing

The Windows PowerShell Owner s Manual: Version 2.0. Jean Ross and Greg Stemp Microsoft Communications Server UA

Backing Up and Recovering Your Server

Microsoft Visual Basic Scripting Edition and Microsoft Windows Script Host Essentials

High-Availability and Scalability

CA ARCserve Replication and High Availability

SQL Server 2005 Express Installation guide

The Luminis Portal and Dashboard Reports

DOAG 2011 DP Tricks-1

CA ARCserve Replication and High Availability

Authoring for System Center 2012 Operations Manager

Fairsail. Implementer. Fairsail to Active Directory Synchronization. Version 1.0 FS-PS-FSAD-IG R001.00

Question: Hi Everyone! Thank you TEACHERS, MICROSOFT, MVA and Event Support Team for this lesson! Answer: Great to see you POPA DAN!

BMC Performance Manager Windows Security White Paper DCOM / WMI

VMware vsphere PowerCLI User's Guide

Windows Command-line Automation Techniques for Dell EqualLogic PS Series Arrays

Using the Citrix Service Provider License Reporting Tool

Version 1.1. Release Date: May 10, 2015

HP Device Monitor (v 1.1) for Microsoft System Center User Guide

Specops Command. Installation Guide

Using Management Shell Reports and Tracking User Access in the NetVanta UC Server

COMMAND-LINE AND AUTOMATION TOOLS

CA ARCserve Replication and High Availability

Banner DBA Survival Guide

Configuring and Integrating PowerShell

Managing Your Workflow System

Buffalo Technology: Migrating your data to Windows Storage Server 2012 R2

Banner Security: A Functional View

NVIDIA WMI. WP _v02 August White Paper

How To Install Outlook Addin On A 32 Bit Computer

Getting Started with the Ed-Fi ODS and Ed-Fi ODS API

HP Device Monitor (v 1.2) for Microsoft System Center User Guide

SPHOL205: Introduction to Backup & Restore in SharePoint Hands-On Lab. Lab Manual

Overview of Active Directory Rights Management Services with Windows Server 2008 R2

PowerShell Support in SCAP 1.2. Michael Tan Microsoft Corporation

Virtualization Hyper-V host scale and scale-up workload support

ActiveRoles Management Shell for Active Directory

Transcription:

SUNGARD SUMMIT 2007 sungardsummit.com 1 Microsoft PowerShell Presented by: Jeff Modzel March 22, 2007 A Community of Learning

Agenda Introduction to PowerShell PowerShell Power Developer Angle Long Term Strategy 2

SUNGARD SUMMIT 2007 sungardsummit.com 3 Introduction to PowerShell A Community of Learning

What is PowerShell? New command-line shell and scripting language Multiple perspectives for use: System Administrators Developers Object based, not text based (.NET 2.0 objects) Can still use the regular, old.exe s you re used to! Formerly code-named Monad Free download from Microsoft 4

What does it look like? 5

Cmdlets (pronounced command-lets ) Command that performs a single function Operate on objects Use a verb-noun naming convention Can chain cmdlets together to do powerful things About 130 built-in cmdlets Can create your own cmdlets 6

Available cmdlets use get-command 7

More examples: Get-command Get-content/set-content Get-childitem Get-process Get-service Get-help Shows all cmdlets installed in the shell. Reads a text file/writes a text file. Equivalent of dir in DOS, for the file system Retrieves the running processes, equivalent to tasklist.exe Retrieves running services, equivalent to sc.exe Gets help for a specific cmdlet 8

Scripting Support New scripting language, object oriented-like Language for manipulating.net objects. Consistent environment for using cmdlets. Support complex tasks, without making simple tasks more complex. Consistent with higher-level languages used in.net programming, such as C#. 9

Scripting Language Variables begin with a $ (variables have scope) Variables are objects and have properties/methods Has all the constructs you d expect from a modern language: if/then, while, for, foreach, do, switch, trap/throw Scripts can be stored in script files (.ps1 extension) or even other variables. Can create and store functions in shell for reuse 10

SUNGARD SUMMIT 2007 sungardsummit.com 11 PowerShell Power A Community of Learning

Object Pipeline Pipes connect cmdlets Pipes pass objects, not text Objects package together related information Examples: get-process format-list out-file c:\list.txt get-service where-object {$_.Status eq Running } get-childitem sort-object length get-content c:\list.txt select-object first 5 get-date get-member 12

General use cmdlets Filtering pipeline objects use where-object, selectobject, sort-object and group-object. Format pipeline objects for output (or other cmdlets) use format-list, format-table, format-wide and formatcustom. 13

Text File manipulation Use set-content, add-content and get-content to read, append and write text files. Can still use > and >> redirection Use import-csv and export-csv to read and write comma separated values files. Note: Excel can use CSV files. Use import-clixml and export-clixml to read and write XML based representations of PowerShell objects 14

Variables Always begin with a $ Can contain any other characters after $ but need to use curly braces No need to declare, just create and use Have scope Variables are.net objects Examples: $var = 1 ${student name} = Joe Smith $date = get-date $a = get-process # returns an array 15

.NET, COM and WMI Can access.net classes, COM objects and WMI with new-object and get-wmiobject. Examples: $wc = new-object Typename System.Net.WebClient $list = new-object System.Collections.ArrayList [System.IO.File]::Exists( c:\junk.txt ) $wsh = new-object ComObject WScript.Shell $fso = new-object Com Scripting.FileSystemObject $ie = new-object Com InternetExplorer.Application $excel = new-object Com Excel.Application 16

WMI continued Windows Management Instrumentation (WMI) is an administration technology for Windows Examples: get-wmiobject class win32_computersystem get-wmiobject win32_operatingsystem Get-wmiobject win32_logicaldisk Get-wmiobject list # show all classes 17

get-wmiobject examples 18

Providers Provides connectivity to a type of resource (data store) File system Registry Alias Environment (windows environment) Function Variable Certificate (digital certificates) PowerShell has it s own concept of a drive location for a data store. See get-psdrive and get-psprovider 19

Scripts PowerShell code can be saved in script files for reuse Use a.ps1 extension Don t forget - can call regular old.exe s in script! Type name of file minus the.ps1 extension and interactive shell will search for the file in the environment Path variable. Or Type full path name with the ps1 extension. Execute with a period. To run the script in the current scope. Interactive shell looks for first for an alias, then function, then cmdlet, then script and finally an external.exe. Execute from DOS\Batch\Windows powershell.exe c:\myscript.ps1 20

Customizing the shell environment Use a profile script to set aliases, functions, map drives or any other startup commands Profiles don t exist by default Profiles are read in order, the last one wins 21

Profiles %windir%\system32\windowspowershell\v1.0\profile.ps1 This profile is loaded for all users. %windir%\system32\windowspowershell\v1.0\ Microsoft.PowerShell_profile.ps1 This profile is loaded for all users, and only for the default instance of PowerShell. %UserProfile%\My Documents\WindowsPowerShell\profile.ps1 This profile is loaded per-user, and affects all versions of PowerShell which are installed. %UserProfile%\\My Documents\WindowsPowerShell\ Microsoft.PowerShell_profile.ps1 This profile is loaded per-user, but only affects the default instance of PowerShell. 22

Security Execution policy determines if user can load configuration files, run scripts and/or require digital signatures for scripts. Integrated with Active Directory / Group Policy Policies are: Restricted, AllSigned, RemoteSigned and Unrestricted Use get/set-executionpolciy to view and change Can use certificates to sign scripts (see setauthenticodesignature) 23

SUNGARD SUMMIT 2007 sungardsummit.com 24 Developer Angle A Community of Learning

Additional things you can do with PowerShell Author cmdlets, providers and filters in Visual Studio Create your own custom shell (typically for integration with other applications) As of 2/7/07, need to install the Windows PowerShell SDK which is part of the Microsoft Windows SDK for Windows Vista. 25

Steps to author a cmdlet Create Visual Studio project Add desired cmdlets and snap-in class Compile to a.dll Register the.dll with installutil.exe (verify with getpssnapin registered) Add snap-in to the shell with add-pssnapin YourSnapIn Verify cmdlets have been added to the shell with getcommand Run new cmdlets! Can use export-console to save state of console for later reuse 26

Creating a custom shell Use the make-shell.exe utility from the SDK Allows creation of customized shells primarily for specialized snap-ins 27

SUNGARD SUMMIT 2007 sungardsummit.com 28 Long Term Strategy A Community of Learning

Where does it fit in Microsoft s strategy? Strategic commitment to.net, PowerShell is built on.net Eventually become part of Windows (not for Vista or Longhorn, though) Exchange 2007 has PowerShell interface known as Exchange Management Shell Some IIS 7 integration 29

Where to get it? Requirements? http://www.microsoft.com/technet/scriptcenter/topics/m sh/download.mspx 2 meg download but needs.net 2.0 OS requirements: Windows XP SP 2, Windows Server 2003, Vista and Longhorn 30

Useful links Homepage http://www.microsoft.com/windowsserver2003/technologie s/management/powershell/default.mspx PowerShell Team Blog http://blogs.msdn.com/powershell/ Other good PowerShell sites http://thepowershellguy.com/blogs/posh/ http://www.microsoft.com/technet/scriptcenter/hubs/msh. mspx 31

Questions & Answers 32

Thank You! Jeff Modzel jeff.modzel@sungardhe.com Please complete the online class evaluation form for: Microsoft PowerShell SunGard, the SunGard logo, Banner, Campus Pipeline, Luminis, PowerCAMPUS, Matrix, and Plus are trademarks or registered trademarks of SunGard Data Systems Inc. or its subsidiaries in the U.S. and other countries. Third-party names and marks referenced herein are trademarks or registered trademarks of their respective owners. 2006 SunGard. All rights reserved. 33