Presentation is loading. Please wait.

Presentation is loading. Please wait.

Nicolas Blank – Zlatan Dzinic Exchange & SharePoint MVP WTB202.

Similar presentations


Presentation on theme: "Nicolas Blank – Zlatan Dzinic Exchange & SharePoint MVP WTB202."— Presentation transcript:

1

2 Nicolas Blank – Zlatan Dzinic Exchange & SharePoint MVP WTB202

3 Agenda What is PowerShell Why do developers care Development scenarios and examples PowerShell Community Resources Demos – in between

4 Present: Windows PowerShell New command-line shell and scripting language As interactive and composable as BASH/KSH As programmatic as Perl/Python/Ruby As production oriented as AS400 CL/VMS DCL Allows access to data stores as easy to access as filesystem

5 The Difference is OBJECTS! Get-Process | Where { $_.handles –gt 500 } | Sort handles | Format-Table Get-Process Cmdlet Common Windows PowerShell Parser Windows PowerShell Pipeline Processor Where Cmdlet Sort Cmdlet Format Cmdlet

6 PowerShell Architecture User Experience ShellLanguageDebugger Engine APIsExecution ContextObject Mgr Managed Elements CmdletsWMICOM.NETXMLADOADSINative Commands

7

8 State Of The Software Phenomenal rate of adoption Over 2 million downloads in less than 18 months Windows XP, Windows Vista, Windows 7, Windows Server 2003 and 2008 Adopted by Exchange, SQL, SCOM, SCVMM, and SCDPM CEC 2009 requirement Dozens of 3 rd party tools, ISVs, and partners Citrix, VMWare, Websphere, etc Strong community engagement, 27 PowerShell MVPs

9 PowerShell Engine Exchange cmdlets Configuration Data Access AD Registry Meta base MAPI Store Process boundary E2007Management Architecture Early-bound objs WinForms ADO.Net PowerShell Data Provider WinForms CLI GUI Setup

10 Forms of Scripting Scripts Filters Functions Script Cmdlets [New in V2]

11 Ad Hoc Run at the command line Simple BASH style Parameters are not named or typed Formal Parameters are named, typed, have initializers Sophisticated Rich error handling Support –Verbose, -Debug, -Confirm, -Whatif Digitally signed

12 A note on Strict mode – In the shell Allows Typo’s to be caught INSIDE the shell (no IDE) PowerShell v1 Set-PSDebug –strict PowerShell V2 Set-StrictMode –version 1 or Set-StrictMode – version 2.

13 Productivity Exchange 2003 (VBScript)E2k7 (PowerShell Script) Mailbox Statistics Set listExchange_Mailboxs = GetObject("winmgmts:{impersonationLevel=impersonate}!\\COMPUTERNAME\ROOT\MicrosoftExchangeV2"). InstancesOf("Exchange_Mailbox") For Each objExchange_Mailbox in listExchange_Mailboxs WScript.echo "AssocContentCount =” + objExchange_Mailbox.AssocContentCount WScript.echo " DateDiscoveredAbsentInDS =” + objExchange_Mailbox.DateDiscoveredAbsentInDS WScript.echo " DeletedMessageSizeExtended =” + objExchange_Mailbox. DeletedMessageSizeExtended WScript.echo " LastLoggedOnUserAccount =” + objExchange_Mailbox. LastLoggedOnUserAccount WScript.echo " LastLogoffTime =” + objExchange_Mailbox. LastLogoffTime WScript.echo " LastLogonTime =” + objExchange_Mailbox. LastLogonTime WScript.echo " LegacyDN =” + objExchange_Mailbox. LegacyDN WScript.echo " MailboxDisplayName =” + objExchange_Mailbox. MailboxDisplayName WScript.echo " MailboxGUID =” + objExchange_Mailbox. MailboxGUID WScript.echo " ServerName =” + objExchange_Mailbox. ServerName WScript.echo " Size =” + objExchange_Mailbox. Size WScript.echo " StorageGroupName =” + objExchange_Mailbox. StorageGroupName WScript.echo " StorageLimitInfo =” + objExchange_Mailbox. StorageLimitInfo WScript.echo " StoreName =” + objExchange_Mailbox. StoreName WScript.echo " TotalItems =” + objExchange_Mailbox. TotalItems Next get-mailboxstatistics –server $servername Database Mgmt Dim StorGroup as New CDOEXM.StorageGroup StorGroup.DataSource.Open "LDAP://" + DCServer + "/ CN=First Storage Group,CN=InformationStore,CN=" + Server + ",CN=Servers,CN=First Administrative Group, CN=Administrative Groups,CN=First Organization, CN=Microsoft Exchange,CN=Services, CN=Configuration," + DomainName StorGroup.MoveLogFiles("C:\newlogPath", 0) move-storagegrouppath -identity “First Storage Group“ –log "C:\newlogPath” Recipient Mgmt Dim objMailbox As CDOEXM.IMailboxStore Set objMailbox = GetObject("LDAP://" + DCServer + "CN=FOO,CN=users," + DomainName) objMailbox.CreateMailbox "LDAP://" + DCServer + "/CN=Private MDB,CN=First Storage Group,CN=InformationStore,CN=" + Server + ",CN=Servers,CN=First Administrative Group, CN=Administrative Groups,CN=First Organization, CN=Microsoft Exchange,CN=Services, CN=Configuration," + DomainName enable-mailbox -identity domain\FOO –database “First Storage Group\Private MDB”

14 Why Do Developer Care? Everybody's doing it Powershell is based on.net - chances are if you're in this room you're using.net today CEC @MS Can run.Net code inside PowerShell Can run PowerShell inside managed code Better visibility into the Object Model Find all the instances of a content type in a Site Automated or repetitive tasks Add a web part to a page on 500 sites Faster Development Cycle

15 Developing Faster Traditional Development Time wasted during Testing PowerShell /.NET Hybrid Development ‘Risky’ development done in PoSH Code converted to.NET (C#/VB) Shorter Deploy/Test Cycle CodeCompileDeployTest Prototyp e (PoSH) CodeCompileDeployTest CodeCompileDeploy

16 .Net calls inside PowerShell PowerShell is.Net based and has full access to the entire.Net stack Easy to do, direct calls with no need to initialise or wrap

17

18 PowerShell INSIDE managed Code PowerShell can be used inside C# Take advantage of PowerShell CMDlets and save coding time Build Winforms GUI’s on top of PowerShell More……

19

20 How to write a CMDlet Either as a PowerShell function – shell code http://technet.microsoft.com/en- us/library/dd315326.aspx Or a.net CMDLET – (compiled code) http://msdn.microsoft.com/en- us/library/dd878294(VS.85).aspx

21

22 PowerShellCommunity.org Forums Cmdlet Library Blogs Wiki Script Repository Software Directory User Group Outreach

23 PowerScripting Podcast Hosts: Jonathan Walz & Hal Rottenberg Online at PowerScripting.netPowerScripting.net Weekly dose of News, Resources, Interviews, Tips and more!

24 PowerShell Tools PowerGui.org – Free PowerShell IDE with intellisense, code snippets and built in debugging PowerTab – intellisense INSIDE the shell http://thepowershellguy.com/blogs/posh/ pages/powertab.aspx http://thepowershellguy.com/blogs/posh/ pages/powertab.aspx

25 Virtual User Group Marco Shaw runs a monthly user’s group meeting online using Microsoft Live Meeting Interviews Q&A with experts Check news for upcoming events and Marco’s get-powershellblog (marcoshaw.blogspot.com) get-powershellblog

26 PowerShell Newsgroup Use NNTP server msnews.microsoft.com or web portal Group name: microsoft.public.windows.powershell

27 #powershell IRC Chat Room Freenode IRC network: irc.freenode.net Web client at powershelllive.com/irc powershelllive.com/irc Only for MVPs and cool people Free real-time scripting advice

28 Microsoft Resources PowerShell Team Blog blogs.msdn.com/powershell blogs.msdn.com/powershell Scripting Guys Script Center microsoft.com/technet/scriptcenter microsoft.com/technet/scriptcenter Hub for official documentation PowerShell Tip of the Week The Windows PowerShell Toolbox Script repository and other goodies

29 Community Resources Newsgroup: Microsoft.Public.Windows.PowerShellMicrosoft.Public.Windows.PowerShell Team blog: http://blogs.msdn.com/PowerShellhttp://blogs.msdn.com/PowerShell PowerShell Community: http://www.powershellcommunity.orghttp://www.powershellcommunity.org Channel 9: http://channel9.msdn.com/tags/PowerShellhttp://channel9.msdn.com/tags/PowerShell Wiki: http://channel9.msdn.com/wiki/default.aspx/Channel9.WindowsPowerShellWikihttp://channel9.msdn.com/wiki/default.aspx/Channel9.WindowsPowerShellWiki Script Center: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspxhttp://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx CodePlex: http://codeplex.com/Project/ProjectDirectory.aspx?TagName=powershellhttp://codeplex.com/Project/ProjectDirectory.aspx?TagName=powershell Books PowerShell in Action by Bruce Payette http://manning.com/powershell http://manning.com/powershell Windows PowerShell Cookbook by Lee Holmes http://www.oreilly.com/catalog/9780596528492/index.html http://www.oreilly.com/catalog/9780596528492/index.html Professional Windows PowerShell Programming http://www.wrox.com/WileyCDA/WroxTitle/productCd-0470173939.html http://www.wrox.com/WileyCDA/WroxTitle/productCd-0470173939.html Many others…

30

31 www.microsoft.com/teched International Content & Community http://microsoft.com/technet Resources for IT Professionals http://microsoft.com/msdn Resources for Developers www.microsoft.com/learning Microsoft Certification & Training Resources Resources Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings from Tech-Ed website. These will only be available after the event. Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings from Tech-Ed website. These will only be available after the event. Tech ·Ed Africa 2009 sessions will be made available for download the week after the event from: www.tech-ed.co.zawww.tech-ed.co.za

32 Related Content Breakout Sessions (session codes and titles) Whiteboard Sessions (session codes and titles) Hands-on Labs (session codes and titles) Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Any queries, please check with your Track Owner. Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Any queries, please check with your Track Owner.

33 Track Resources Resource 1 Resource 2 Resource 3 Resource 4 Required Slide Track Owners to provide guidance. Please address any queries to your track owners. Required Slide Track Owners to provide guidance. Please address any queries to your track owners.

34 Required Slide Complete a session evaluation and enter to win! 10 pairs of MP3 sunglasses to be won

35 © 2009 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. Required Slide


Download ppt "Nicolas Blank – Zlatan Dzinic Exchange & SharePoint MVP WTB202."

Similar presentations


Ads by Google