powershell richard siddaway perot systems. welcome to this technet event “pick your own...

Download PowerShell Richard Siddaway Perot Systems. Welcome to this TechNet Event “Pick your Own Collateral” URL for on-line feedback is in your reminder e-mail

If you can't read please download the document

Upload: trevor-richard

Post on 18-Jan-2018

214 views

Category:

Documents


0 download

DESCRIPTION

The TechNet Programme A range of tools and resources for IT Professionals FREE TechNet Newsletter FREE Events and Webcasts FREE TechNet BETA Central (www.microsoft.com/uk/betacentral) FREE Quarterly TechNet Magazine FREE comprehensive technical website FREE TechNet Radio, Security Centre, Learning Paths and Virtual Labs TechNet Plus – Now available for Download!

TRANSCRIPT

PowerShell Richard Siddaway Perot Systems Welcome to this TechNet Event Pick your Own Collateral URL for on-line feedback is in your reminderNo Planned Fire Drills Please turn your Mobile Phones off To find out about future TechNet events: The TechNet Programme A range of tools and resources for IT Professionals FREE TechNet Newsletter FREE Events and Webcasts FREE TechNet BETA Central (www.microsoft.com/uk/betacentral) FREE Quarterly TechNet Magazine FREE comprehensive technical website FREE TechNet Radio, Security Centre, Learning Paths and Virtual Labs TechNet Plus Now available for Download! What is TechNet Plus? The Toolkit for IT Professionals TechNet Plus is an annual subscription Access to TechNet Knowledge Base No-limits Evaluation software for Testing Beta software available immediately 2 Free Technical Support calls worth 320 20% off all further Support Calls Managed Newsgroups with guaranteed answers in 24hrs Now available by Download from only 230 / year (excl VAT) For all information on TechNet Plus Subscriptions visit: Agenda Learning to Fish.NET and PowerShell Managing AD with Quest Cmdlets and PowerGUI Windows Server System Security Infrastructure IT Operations Infrastructure Applications Infrastructure Collaboration Infrastructure Learning to Fish Invest and learn how to: Learn and leverage others work Discover the system Leverage utilities Formalize your work Learning and Leveraging In the Box Documents Getting Started, Users Guide, Quick Reference Guide HelpBooks Invest in your integrated lifetime earnings Community A wise man learns from mistakes Practice ad hoc development Try things out in an interactive shell Stitch things together with utilities Put the results in a script file Realize that the tools are unsuitable and restart with a new set of tools Generalize (e.g., parameterize) Clean it up production-quality Integrate into your environment Share with the community Ad Hoc Development UtilitiesDiscovery Get-Help, Get-Member, Get-Command Object Manipulation Compare, Group, Measure, Select, Sort, Tee, Where Formatting Format-(Custom, List, Table, Wide) Out-(File, Host, Printer, String) Export/Import-(Clixml, CSV) ConvertTo-Html Learning to Fish Agenda.NET and PowerShell Managing AD with Quest Cmdlets and PowerGUI Accessing.NET Simple scripters need [STRING] and [MATH] Advanced scripters get any.Net object they want Cmdlets provide the best admin and scripting experience.NET provides a safety net of coverage PowerShell provides access to the entirety of the.NET Frameworks Accessing.NET Creating.Net objects $d=New-Object System.DateTime 2005,4,20 [DateTime] Parse(), Constructor, Converter Inspecting properties-methods $d |Get-Member $d |Get-Member Static Accessing properties-methods Instance$d.DayOfWeek$d.AddMonths(6)Static[DateTime]::Now[DateTime]::IsLeapYear(2005) Method matching is done via least-type differencing Use casts to override [DateTime]::IsLeapYear([INT]$x) Accessing.NET Agenda Learning to Fish.NET and PowerShell Managing AD with Quest Cmdlets and PowerGUI PowerShell Community Extensions Snapin containing additional cmdlets Active Directory Provider Access AD as if it was the file system Dir through Active Directory Where do I get the Extensions?ame=PowerShellCXame=PowerShellCX PowerShell CMDLETS for Active Directory What is ActiveRoles Management Pack for PowerShell? PowerShell CMDLETS for managing Active Directory or Active Directory through Quest ActiveRoles Server What do the CMDLETS cost? The CMDLETS are free Where do I get the Management Pack?or PowerShell CMDLETS for Active Directory with ActiveRoles Server Active Directory or ADAM Microsoft Power Shell Roles Policies Applications Databases Home Folders Exchange Mailboxes Virtual Schema Approval Workflow -proxy switch Provisioning and Management for Active Directory, ADAM and beyond CMDLETS work directly with Active Directory or via the ActiveRoles Server proxy Automated User & Group Management ActiveRoles Domain Controller Quest ActiveRoles Server PowerGUI and the PowerGUI.Org Community What is PowerGUI? Graphical Administrative Console for PowerShell What does PowerGUI cost? The PowerGUI application is free Where Can I get PowerGUI? PowerGUI and the PowerGUI.Org Community Visit PowerGUI.org today Download the PowerGUI Application Download PowerShell CMDLETS Share your own PowerShell CMDLETS Gain or Share PowerShell Expertise Managing Active Directory Summary/Call to Action Powershell can be used to administer large and growing parts of your environment Now available at: Search for PowerShell Try it, Deploy it, Use it, Share For More Information User group:My BlogPowerShell for IT Admins May 22 https://msevents.microsoft.com/cui/EventDe tail.aspx?culture=en- GB&eventid= https://msevents.microsoft.com/cui/EventDe tail.aspx?culture=en- GB&eventid= Community Resources Newsgroup: Microsoft.Public.Windows.PowerShell Team blog: Channel 9 tag: OMark van Orsouws blog:Wiki:Wiki Script Center:Manning Press book by Bruce Payette: PowerShell in ActionOReilly book Monad: Introducing the MSH Command Shell and LanguageSapien Press book by Don Jones: PowerShellMshAnalyzer tool Resources Technical Chats and Webcasts Microsoft Learning and CertificationMSDN & TechNet Virtual LabsNewsgroupscommunities/newsgroups/en-us/default.aspx Technical Community SitesUser Groups Any Questions? Thank you for attending this TechNet Event Find these slides at: Reference Slides Scripting with COM Access existing instrumentation Bind to COM objects $fso = New-Object -ComObject Scripting.FileSystemObject $m = [System.Runtime.InteropServices.Marshal] $word = $m::GetActiveObject("Word.Application") Invoke methods/access properties $fso.GetDrive(C:) $fso.VolumeName = System Drive Understand/extend instrumentation Extend and discover properties/methods Update-TypeData Office.Word.Types.ps1xml $fso | Get-Member Manipulate and format results Define and import custom formating Update-FormatData Office.Word.Format.ps1xml $word.RecentFiles | Sort name | Format-Table Allows more simpler/more powerful COM scripts because of utilities and formatting Scripting with WMI PowerShell provides native WMI support Get-WmiObject Allows for inspection of WMI namespace Get-WmiObject list [-Namespace xx] Get-WmiObject Class xx Namespace xx Property xxx Filter xxx ComputerName xxx Credential xxx Native language support [WMI] \\JPSDESK10\root\cimv2:Win32_Process.Handle="0 \\JPSDESK10\root\cimv2:Win32_Process.Handle="0 [WMICLASS] "ROOT\cimv2:WIN32_PROCESS" [WMISEARCHER]"select * from Win32_process WHERE Name = 'calc.exe'" Scripting with.NET PowerShell provides native access to any.NET class Create any object [reflection.assembly]::LoadWithPartialName("System.Wind ows.Forms") $d = New-Object System.DateTime 2006,12,25 Access Properties/Invoke Methods $d.DayOfWeek$d.AddDays(-30) Access Statics [DateTime]::Now[DateTime]::IsLeapYear(2006) Allows admins to easily access and leverage a huge API set because of scriptability, utilities and formatting Scripting with XML PowerShell provides native XML support Native datatype $x=[xml]"TEST $b =[xml](type c:\i386\mssecure.xml) Native syntax to access data view of properties $b.BulletinDataStore.Bulletins.Bulletin[0] Access to XML methods $b.BulletinDataStore.SelectNodes(//Patch) XML properties available through PSBase property $b.BulletinDataStore.PSBase.innerXml Scripting with Text Invoke existing tools Existing command run directly after variables are expanded Harvest data from existing tools Parse output into variables using text utilities. Pipe data to SELECT and use FIRST and LAST Select-String Select-String Dir | Select-String Dir | Select-String [DateTime]12/25/2006 7:00 ([DateTime]12/25/2006 7:00).AddDays(-30) Use functions/scripts to wrap the commands and convert output to objects or provide standard syntax Safely process text Use CLR types via Windows PowerShell to safely parse text [URI]Allows admins to get 2-10x more power out of existing commands because of scriptability