logging in or signing up Scripting Winter 2006 Mentor Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 238 Category: Product Traini.. License: All Rights Reserved Like it (0) Dislike it (0) Added: June 19, 2007 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Slide1: John Kelbley Steve Carbone Account Technology Specialist Account Technology Specialist Microsoft Microsoft johnkel@Microsoft.com scarbone@Microsoft.com Steve was late tonight He was flying back from Virginia Goals Of The Presentation: Goals Of The Presentation Enjoy the Holiday Event! Understanding of script usage by Windows IT Pros Review high-level automation options / tools The new face of Windows automation – PowerShell Cool stuff you can do PowerShell roadmap My favorite tool - WMIC Differences from PowerShell Cool stuff you can do Resources Review Events you need to know about Goals Of The Presentation: Goals Of The Presentation Enjoy the Holiday Event! Understanding of script usage by Windows IT Pros Review high-level automation options / tools The new face of Windows automation – PowerShell Cool stuff you can do PowerShell roadmap My favorite tool - WMIC Differences from PowerShell Cool stuff you can do Resources Review Events you need to know about IT Professional Do Windows IT Pros use a CLI shell and scripts?: Do Windows IT Pros use a CLI shell and scripts? 75% of Windows IT Pros in MidMarket andamp; Enterprise use CMD.EXE. PERLshell is a clear second, but with only 24% usage 71% of Windows IT Pros use CMD/BAT scripts for desktop system administration. 46% of IT Pros use VBScripts for desktop system administration. 'Lack of Time' is a common reason why IT Pros do not use scripts for system administration. – Microsoft Internal Research 2005 (N=171) What do IT Pros use scripts for?: What do IT Pros use scripts for? Almost all system administration tasks! andgt;75% of IT Pros would like to automate more Slide6: Ease of use Easy to write scripts without a systems programmer Consistency across all Windows features A single command shell and a consistent command line experience across all Windows components Compatibility with existing infrastructure Backward compatibility Microsoft Internal Research – 2005 – (171 IT Pros) What are the most valued features in a new shell or scripting language? Slide7: Learning curve / Lack of training / Lack of examples 'The biggest obstacle to using WMI and the variety of AD scripting methods that exist now is that it's too complicated for a non-developer to learn.' 'Lack of sample scripts to perform common tasks and the need to be a developer in order to develop new scripts' Lack of compatibility with existing tools, scripts andamp; OSes 'Can I run it on Windows 2000, 2003, and Longhorn, or just the latest Longhorn? If only the latter, that would severely impact its usefulness to us.' 'Lack of backwards compatibility with preexisting utilities, scripts, etc.' Cost to purchase or migrate 'Cost. That always seems to be the big blocker.' Lack of evidence of adoption or value for an organization 'Need evidence that others are using it.' Microsoft Internal Research – 2006 What are top blockers that would prevent deployment of a new scripting language? Slide8: Inconsistent Naming Syntax Help Output Too few utilities Missing integration between Shell and scripting language Command line and GUIs Bottom line: CMD.Exe tools and VBScript are not optimal for maximizing IT Pro productivity and task automation. What are the limitations of current CMD.exe andamp; MS scripting languages? Goals Of The Presentation: Goals Of The Presentation Enjoy the Holiday Event! Understanding of script usage by Windows IT Pros Review high-level automation options / tools The new face of Windows automation – PowerShell Cool stuff you can do PowerShell roadmap My favorite tool - WMIC Differences from PowerShell Cool stuff you can do Resources Review Events you need to know about Tool Automation Tools You Must Know About… : Automation Tools You Must Know About… PowerShell WMIC VBScript Yes, there’s way more, but this is the stuff I like to talk about! (plus we bought dinner!) Slide11: Easy to Use Easy to Adopt Supports existing OSes, scripts and cmd line tools Easy to Learn shell andamp; language Intuitive verb-noun syntax Get-process; get-wmiobject Easy to Use – Admin-focused utilities andamp; commands Ability to navigate management data as if it is a file system You are more productive. Provides greater control of the Windows environment Accelerates automation of system administration What are benefits of Windows PowerShell? Windows PowerShell Design Principals: Windows PowerShell Design Principals Preserves investment Existing scripts and command line tools Commands, VB, COM, WMI, … Powerful object manipulation Objects can be directly manipulated Pipelined to other tools Expose the consistency andamp; functionality of .NET to IT Pros Extensibility for administrators Quickly write scripts Customize commands Author their own tools ('cmdlets') Easy development model Ease new tool development Windows PowerShell Overview: Windows PowerShell Overview Easy to Use Designed for non-programmers Uniform syntax, naming, help, output, semantics Built in utilities Datastores exposed as filesystems Native, uniform support for ADSI, WMI, COM, XML, ADO, HTML, CSV Easy to Adopt Free Runs on Windows XP, Windows Server 2003, Windows Vista and Windows Server 'Longhorn'. Existing commands and scripts get 2-10x more powerful by invoking them from PowerShell Easy to Learn Extensive learning content (getting started guides, books, webcasts), script examples and community support make it easy for you to learn to use Windows PowerShell. Robust community support via blogs, discussion groups and sharing of scripts Extensive script examples for system administration reduce amount of time required to write a custom script. New command line shell and scripting language designed to make IT Professionals more productive and accelerate automation. Windows PowerShell Overview: Windows PowerShell Overview IT Pros are more productive Scripting language supports wide range of scripting styles from simple to sophisticated Powerful utilities reduce the amount of programming required to do sophisticated tasks Leverages the power of .NET Logging, error-handling, debug and trace capabilities Slide15: John’s 2nd Favorite Command… Cool PowerShell Stuff to know: Cool PowerShell Stuff to know You can go new places! Get-psdrive Name Provider Root ---- -------- ---- Alias Alias C FileSystem C:\ cert Certificate \ D FileSystem D:\ Env Environment Function Function HKCU Registry HKEY_CURRENT_USER HKLM Registry HKEY_LOCAL_MACHINE Variable Variable You can navigate the registry! cd hklm: You can navigate the certificate store! cd cert: Cool PowerShell Stuff to know: Cool PowerShell Stuff to know You find out about 'parts' Get-service | Get-member You can make graphs! get-process | sort-object WS -descending | select-object -first 8 | select-object name,ws |out-chart -gallery pie …but I don’t have a sample of this… …because I don’t have the 'out-chart' created… …because I ran out of time… …but you can do it by going to the TechNet Script Center! Cool PowerShell Stuff to know: Cool PowerShell Stuff to know You do LOTS of things…loop, color code…. $colItems = get-wmiobject Win32_Process foreach ($objItem in $colItems) { if ($objItem.WorkingSetSize -gt 30000000) { write-host $objItem.Name, $objItem.WorkingSetSize -foregroundcolor 'magenta' } else {write-host $objItem.Name, $objItem.WorkingSetSize} } Cool PowerShell Stuff to know: Cool PowerShell Stuff to know get-process | sort –descending WS Sort Results… Maybe you don’t link magenta? (and you’re lazy like me) Sample CmdLts I might have used…: Sample CmdLts I might have used… SERVICE Get-Service Get-Service | Where-Object {$_.status –eq 'stopped'} Get-Service | Where-Object {$_.status –eq 'running'} Get-Service | Sort-Object status,displayname Set-Service clipsrv -startuptype 'manual' Restart-Service -displayname 'bluetooth service' Restart-Service btwdins Restart-Service btwdins,alerter Stop-Service btwdins Start-Service btwdins WMI DATA COLLECTION Get-WmiObject win32_bios Get-WmiObject win32_bios -computername johnkel-junk Get-WmiObject win32_bios | get-member Get-WmiObject -namespace root\ccm -class sms_client Get-WmiObject -namespace root\ccm -class sms_client -computername johnkel-junk Windows PowerShell Roadmap: Windows PowerShell Roadmap Windows PowerShell available now as a download from microsoft.com\downloads Available for Windows XP andamp; Windows Server 2003 Requires .NET Framework 2.0 Vista RTM support coming soon Windows PowerShell is part of the 2009 Common Engineering Criteria PowerShell Call To Action: PowerShell Call To Action Download and evaluate Windows PowerShell www.microsoft.com/powershell Please consider whether PowerShell will provide value to you! PowerShell Links & Resources: PowerShell Links andamp; Resources WMIC: John’s Favorite Command: WMIC: John’s Favorite Command Server Core Desktop: Server Core Desktop Slide26: John’s Favorite Command… Sample WMIC stuff I may have used…: Sample WMIC stuff I may have used… HARDWARE cpu get maxclockspeed memorychip Memphyiscal PATCH MANAGEMENT qfe get /output:c:\test.csv qfe get /all /format:csv /output:c:\test.html qfe get /all /format:htable.xsl OTHER WMIC OS Get Useraccount Startup share Service /output:c:\test.html NTEVENT WHERE 'Logfile='Application' and TimeGeneratedandgt;'2003.09.01' and EventTypeandlt;'2'' GET Message,SourceName,TimeGenerated /format:htable.xsl DISK WMIC logicaldisk Where drivetype=3 Get name,freespace,SystemName,FileSystem,Size,VolumeSerialNumber HTML Output: Table: HTML Output: Table HTML Output: Table: HTML Output: Table HTML Output: Table: HTML Output: Table HTML Output: Form: HTML Output: Form Putting it all Together…: Putting it all Together… for /F %%i in (serverlist.txt) do ( echo Processing %%i... wmic /Failfast:on /node:'%%i' /output:'%%i_OS.html' OS Get /All wmic /Failfast:on /node:'%%i' /output:'%%i_qfe.html' QFE where 'Descriptionandlt;andgt;''' Get /All wmic /Failfast:on /node:'%%i' /output:'%%i_drives.html' logicaldisk get caption, description, filesystem, size, freespace, compressed ) WMIC Call to Action!: WMIC Call to Action! 6/18/2007 33 (total shameless plug!) Goals Of The Presentation: Goals Of The Presentation Enjoy the Holiday Event! Understanding of script usage by Windows IT Pros Review high-level automation options / tools The new face of Windows automation – PowerShell Cool stuff you can do PowerShell roadmap My favorite tool - WMIC Differences from PowerShell Cool stuff you can do Resources Review Events you need to know about Love TechNet!http://technet.microsoft.com/en-us/default.aspx: Love TechNet! http://technet.microsoft.com/en-us/default.aspx Learn to Love the Script Center http://www.microsoft.com/technet/scriptcenter/default.mspx: Learn to Love the Script Center http://www.microsoft.com/technet/scriptcenter/default.mspx Goals Of The Presentation: Goals Of The Presentation Enjoy the Holiday Event! Understanding of script usage by Windows IT Pros Review high-level automation options / tools The new face of Windows automation – PowerShell Cool stuff you can do PowerShell roadmap My favorite tool - WMIC Differences from PowerShell Cool stuff you can do Resources Review Events you need to know about Upcoming Events!: Upcoming Events! You do not have the permission to view this presentation. In order to view it, please contact the author of the presentation.
Scripting Winter 2006 Mentor Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 238 Category: Product Traini.. License: All Rights Reserved Like it (0) Dislike it (0) Added: June 19, 2007 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Slide1: John Kelbley Steve Carbone Account Technology Specialist Account Technology Specialist Microsoft Microsoft johnkel@Microsoft.com scarbone@Microsoft.com Steve was late tonight He was flying back from Virginia Goals Of The Presentation: Goals Of The Presentation Enjoy the Holiday Event! Understanding of script usage by Windows IT Pros Review high-level automation options / tools The new face of Windows automation – PowerShell Cool stuff you can do PowerShell roadmap My favorite tool - WMIC Differences from PowerShell Cool stuff you can do Resources Review Events you need to know about Goals Of The Presentation: Goals Of The Presentation Enjoy the Holiday Event! Understanding of script usage by Windows IT Pros Review high-level automation options / tools The new face of Windows automation – PowerShell Cool stuff you can do PowerShell roadmap My favorite tool - WMIC Differences from PowerShell Cool stuff you can do Resources Review Events you need to know about IT Professional Do Windows IT Pros use a CLI shell and scripts?: Do Windows IT Pros use a CLI shell and scripts? 75% of Windows IT Pros in MidMarket andamp; Enterprise use CMD.EXE. PERLshell is a clear second, but with only 24% usage 71% of Windows IT Pros use CMD/BAT scripts for desktop system administration. 46% of IT Pros use VBScripts for desktop system administration. 'Lack of Time' is a common reason why IT Pros do not use scripts for system administration. – Microsoft Internal Research 2005 (N=171) What do IT Pros use scripts for?: What do IT Pros use scripts for? Almost all system administration tasks! andgt;75% of IT Pros would like to automate more Slide6: Ease of use Easy to write scripts without a systems programmer Consistency across all Windows features A single command shell and a consistent command line experience across all Windows components Compatibility with existing infrastructure Backward compatibility Microsoft Internal Research – 2005 – (171 IT Pros) What are the most valued features in a new shell or scripting language? Slide7: Learning curve / Lack of training / Lack of examples 'The biggest obstacle to using WMI and the variety of AD scripting methods that exist now is that it's too complicated for a non-developer to learn.' 'Lack of sample scripts to perform common tasks and the need to be a developer in order to develop new scripts' Lack of compatibility with existing tools, scripts andamp; OSes 'Can I run it on Windows 2000, 2003, and Longhorn, or just the latest Longhorn? If only the latter, that would severely impact its usefulness to us.' 'Lack of backwards compatibility with preexisting utilities, scripts, etc.' Cost to purchase or migrate 'Cost. That always seems to be the big blocker.' Lack of evidence of adoption or value for an organization 'Need evidence that others are using it.' Microsoft Internal Research – 2006 What are top blockers that would prevent deployment of a new scripting language? Slide8: Inconsistent Naming Syntax Help Output Too few utilities Missing integration between Shell and scripting language Command line and GUIs Bottom line: CMD.Exe tools and VBScript are not optimal for maximizing IT Pro productivity and task automation. What are the limitations of current CMD.exe andamp; MS scripting languages? Goals Of The Presentation: Goals Of The Presentation Enjoy the Holiday Event! Understanding of script usage by Windows IT Pros Review high-level automation options / tools The new face of Windows automation – PowerShell Cool stuff you can do PowerShell roadmap My favorite tool - WMIC Differences from PowerShell Cool stuff you can do Resources Review Events you need to know about Tool Automation Tools You Must Know About… : Automation Tools You Must Know About… PowerShell WMIC VBScript Yes, there’s way more, but this is the stuff I like to talk about! (plus we bought dinner!) Slide11: Easy to Use Easy to Adopt Supports existing OSes, scripts and cmd line tools Easy to Learn shell andamp; language Intuitive verb-noun syntax Get-process; get-wmiobject Easy to Use – Admin-focused utilities andamp; commands Ability to navigate management data as if it is a file system You are more productive. Provides greater control of the Windows environment Accelerates automation of system administration What are benefits of Windows PowerShell? Windows PowerShell Design Principals: Windows PowerShell Design Principals Preserves investment Existing scripts and command line tools Commands, VB, COM, WMI, … Powerful object manipulation Objects can be directly manipulated Pipelined to other tools Expose the consistency andamp; functionality of .NET to IT Pros Extensibility for administrators Quickly write scripts Customize commands Author their own tools ('cmdlets') Easy development model Ease new tool development Windows PowerShell Overview: Windows PowerShell Overview Easy to Use Designed for non-programmers Uniform syntax, naming, help, output, semantics Built in utilities Datastores exposed as filesystems Native, uniform support for ADSI, WMI, COM, XML, ADO, HTML, CSV Easy to Adopt Free Runs on Windows XP, Windows Server 2003, Windows Vista and Windows Server 'Longhorn'. Existing commands and scripts get 2-10x more powerful by invoking them from PowerShell Easy to Learn Extensive learning content (getting started guides, books, webcasts), script examples and community support make it easy for you to learn to use Windows PowerShell. Robust community support via blogs, discussion groups and sharing of scripts Extensive script examples for system administration reduce amount of time required to write a custom script. New command line shell and scripting language designed to make IT Professionals more productive and accelerate automation. Windows PowerShell Overview: Windows PowerShell Overview IT Pros are more productive Scripting language supports wide range of scripting styles from simple to sophisticated Powerful utilities reduce the amount of programming required to do sophisticated tasks Leverages the power of .NET Logging, error-handling, debug and trace capabilities Slide15: John’s 2nd Favorite Command… Cool PowerShell Stuff to know: Cool PowerShell Stuff to know You can go new places! Get-psdrive Name Provider Root ---- -------- ---- Alias Alias C FileSystem C:\ cert Certificate \ D FileSystem D:\ Env Environment Function Function HKCU Registry HKEY_CURRENT_USER HKLM Registry HKEY_LOCAL_MACHINE Variable Variable You can navigate the registry! cd hklm: You can navigate the certificate store! cd cert: Cool PowerShell Stuff to know: Cool PowerShell Stuff to know You find out about 'parts' Get-service | Get-member You can make graphs! get-process | sort-object WS -descending | select-object -first 8 | select-object name,ws |out-chart -gallery pie …but I don’t have a sample of this… …because I don’t have the 'out-chart' created… …because I ran out of time… …but you can do it by going to the TechNet Script Center! Cool PowerShell Stuff to know: Cool PowerShell Stuff to know You do LOTS of things…loop, color code…. $colItems = get-wmiobject Win32_Process foreach ($objItem in $colItems) { if ($objItem.WorkingSetSize -gt 30000000) { write-host $objItem.Name, $objItem.WorkingSetSize -foregroundcolor 'magenta' } else {write-host $objItem.Name, $objItem.WorkingSetSize} } Cool PowerShell Stuff to know: Cool PowerShell Stuff to know get-process | sort –descending WS Sort Results… Maybe you don’t link magenta? (and you’re lazy like me) Sample CmdLts I might have used…: Sample CmdLts I might have used… SERVICE Get-Service Get-Service | Where-Object {$_.status –eq 'stopped'} Get-Service | Where-Object {$_.status –eq 'running'} Get-Service | Sort-Object status,displayname Set-Service clipsrv -startuptype 'manual' Restart-Service -displayname 'bluetooth service' Restart-Service btwdins Restart-Service btwdins,alerter Stop-Service btwdins Start-Service btwdins WMI DATA COLLECTION Get-WmiObject win32_bios Get-WmiObject win32_bios -computername johnkel-junk Get-WmiObject win32_bios | get-member Get-WmiObject -namespace root\ccm -class sms_client Get-WmiObject -namespace root\ccm -class sms_client -computername johnkel-junk Windows PowerShell Roadmap: Windows PowerShell Roadmap Windows PowerShell available now as a download from microsoft.com\downloads Available for Windows XP andamp; Windows Server 2003 Requires .NET Framework 2.0 Vista RTM support coming soon Windows PowerShell is part of the 2009 Common Engineering Criteria PowerShell Call To Action: PowerShell Call To Action Download and evaluate Windows PowerShell www.microsoft.com/powershell Please consider whether PowerShell will provide value to you! PowerShell Links & Resources: PowerShell Links andamp; Resources WMIC: John’s Favorite Command: WMIC: John’s Favorite Command Server Core Desktop: Server Core Desktop Slide26: John’s Favorite Command… Sample WMIC stuff I may have used…: Sample WMIC stuff I may have used… HARDWARE cpu get maxclockspeed memorychip Memphyiscal PATCH MANAGEMENT qfe get /output:c:\test.csv qfe get /all /format:csv /output:c:\test.html qfe get /all /format:htable.xsl OTHER WMIC OS Get Useraccount Startup share Service /output:c:\test.html NTEVENT WHERE 'Logfile='Application' and TimeGeneratedandgt;'2003.09.01' and EventTypeandlt;'2'' GET Message,SourceName,TimeGenerated /format:htable.xsl DISK WMIC logicaldisk Where drivetype=3 Get name,freespace,SystemName,FileSystem,Size,VolumeSerialNumber HTML Output: Table: HTML Output: Table HTML Output: Table: HTML Output: Table HTML Output: Table: HTML Output: Table HTML Output: Form: HTML Output: Form Putting it all Together…: Putting it all Together… for /F %%i in (serverlist.txt) do ( echo Processing %%i... wmic /Failfast:on /node:'%%i' /output:'%%i_OS.html' OS Get /All wmic /Failfast:on /node:'%%i' /output:'%%i_qfe.html' QFE where 'Descriptionandlt;andgt;''' Get /All wmic /Failfast:on /node:'%%i' /output:'%%i_drives.html' logicaldisk get caption, description, filesystem, size, freespace, compressed ) WMIC Call to Action!: WMIC Call to Action! 6/18/2007 33 (total shameless plug!) Goals Of The Presentation: Goals Of The Presentation Enjoy the Holiday Event! Understanding of script usage by Windows IT Pros Review high-level automation options / tools The new face of Windows automation – PowerShell Cool stuff you can do PowerShell roadmap My favorite tool - WMIC Differences from PowerShell Cool stuff you can do Resources Review Events you need to know about Love TechNet!http://technet.microsoft.com/en-us/default.aspx: Love TechNet! http://technet.microsoft.com/en-us/default.aspx Learn to Love the Script Center http://www.microsoft.com/technet/scriptcenter/default.mspx: Learn to Love the Script Center http://www.microsoft.com/technet/scriptcenter/default.mspx Goals Of The Presentation: Goals Of The Presentation Enjoy the Holiday Event! Understanding of script usage by Windows IT Pros Review high-level automation options / tools The new face of Windows automation – PowerShell Cool stuff you can do PowerShell roadmap My favorite tool - WMIC Differences from PowerShell Cool stuff you can do Resources Review Events you need to know about Upcoming Events!: Upcoming Events!