370 likes | 491 Vues
Goals Of The Presentation. Enjoy the Holiday Event!Understanding of script usage by Windows IT ProsReview high-level automation options / toolsThe new face of Windows automation
E N D
1. 2006 Holiday Season Scripting Technology Update John Kelbley Steve Carbone
Account Technology Specialist Account Technology Specialist
Microsoft Microsoft
johnkel@Microsoft.com scarbone@Microsoft.com Title screen you can use if you want to include photos/titles for both presenters.Title screen you can use if you want to include photos/titles for both presenters.
2. 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
3. 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
4. Do Windows IT Pros use a CLI shell and scripts? 75% of Windows IT Pros in MidMarket & 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)
5. What do IT Pros use scripts for? Almost all system administration tasks!
>75% of IT Pros would like to automate more
6. 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)
7. 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 & 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
8. 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.
9. 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
10. Automation Tools You Must Know About PowerShell
WMIC
VBScript
11. Easy to Use
Easy to Adopt
Supports existing OSes, scripts and cmd line tools
Easy to Learn shell & language
Intuitive verb-noun syntax
Get-process; get-wmiobject
Easy to Use
Admin-focused utilities & 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
12. 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 & 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
13. 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.
14. 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
15. PowerShell Demo Johns 2nd Favorite Command
16. 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:
17. 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
18. Cool PowerShell Stuff to know You do LOTS of thingsloop, 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}
}
19. Cool PowerShell Stuff to know get-process | sort descending WS
20. Sample CmdLts I might have used EvENTLOG
Get-EventLog list
Get-EventLog -list | Where-Object {$_.logdisplayname -eq "System"}
get-eventlog system
Get-EventLog system -newest 10
Get-EventLog system -newest 3 | Format-List
Get-EventLog Windows System | Where-Object {$_.EventID -eq 3004}
get-eventlog system | findstr "WinDefend"
Get-EventLog system | Group-Object eventid | Sort-Object Name
Get-EventLog system | Group-Object eventid | Sort-Object Count
help sort
Get-EventLog system | Group-Object eventid | Sort-Object Count descending
PROCESS
Get-Process
Get-Process powerpnt
Get-Process p*
Get-Process | Select-Object name,fileversion,productversion,company
Stop-Process processname notepad
21. Windows PowerShell Roadmap Windows PowerShell available now as a download from microsoft.com\downloads
Available for Windows XP & Windows Server 2003
Requires .NET Framework 2.0
Vista RTM support coming soon
Windows PowerShell is part of the 2009 Common Engineering Criteria
22. PowerShell Call To Action Download and evaluate Windows PowerShell
www.microsoft.com/powershell
Please consider whether PowerShell will provide value to you!
23. PowerShell Links & Resources Try to limit to TOP 5 links and ResourcesTry to limit to TOP 5 links and Resources
24. WMIC: Johns Favorite Command Command line interface to WMI
Developed by the same folks that created PowerShell
Comes in the box and with XP, Server 2003, Vista, and Longhorn
Works on Server Core
25. Server Core Desktop
26. WMIC Demo Johns Favorite Command
27. Sample WMIC stuff I may have used PROCESS
Process
process list
PROCESS WHERE NAME="notepad.exe" CALL Terminate
process where description="notepad.exe" delete
Process call create "calc.exe
Process where Name="calc.exe" call Terminate
Process where name="svchost.exe" get name, processid
NETWORK CONFIGURATION
Nicconfig
nicconfig get macaddress
Set Static Network Config
NICCONFIG where Index=1 Call Enable Static ("10.0.0.2"),("255.0.0.0")
:Set Gateways
NICCONFIG where Index=1 Call SetGateways ("10.0.0.8"),("10.0.0.9"),(1,2)
:Set WINS
NICCONFIG where Index=1 Call SetWINSServer ("10.11.12.13"),("10.22.23.24")
:Set DHCP
NICCONFIG WHERE Index=1 CALL Enable DHCP
/FAILFAST /NODE:@filename.txt NICCONFIG WHERE Index=1 CALL Enable DHCP
28. HTML Output: Table WMIC /output:c:\os1.html os get /all /format:htable.xsl
29. HTML Output: Table WMIC /output:c:\os_list.html /Node:johnkelnc6000, "johnkel-fer", "johnkel-lhsrv" os get Caption, CSDVersion /format:htable.xsl
30. HTML Output: Table WMIC /output:c:\os1.html os get /all /format:htable.xsl
31. HTML Output: Form WMIC /output:c:\os2.html os get /all /format:hform.xsl
32. Putting it all Together
33. WMIC Call to Action! Use it to automate admin tasks NOW!
Checkout September 2006 TechNet Magazinehttp://www.microsoft.com/technet/technetmag/issues/2006/09/WMIData/default.aspx
5/24/2012 33
34. 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
35. Love TechNet!http://technet.microsoft.com/en-us/default.aspx
36. Learn to Love the Script Center http://www.microsoft.com/technet/scriptcenter/default.mspx
37. 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
38. Upcoming Events! Ready for a New Day: Launch Tour 2007
January 24th Boston, MA
Do you want to experience Windows Vista, the 2007 Microsoft Office system, and Microsoft Exchange Server 2007? Then RSVP microsoft.com/usa/events or call 877-MSEVENT and refer to Event ID: 1032314637