Dan Reger Sr. Product Manager Microsoft WSV319 Presentation Outline (hidden slide): Title: Windows...
-
Upload
paula-tate -
Category
Documents
-
view
215 -
download
1
Transcript of Dan Reger Sr. Product Manager Microsoft WSV319 Presentation Outline (hidden slide): Title: Windows...
Windows PowerShell and Windows Server 2008 R2
Dan RegerSr. Product ManagerMicrosoftWSV319
AgendaIntroduction to PowerShell
…Within the Context of ManagementPowerShell Goals and ThemesPowerShell 2.0
GUI over PowerShell (Demo)Production Scripting (Demo)Community Feedback
Interlude - PowerShellCommunity.orgPowerShell 2.0 (continued)
Universal Automation EnvironmentDemo – Compellent Technologies
Today’s IT Challenges
Increasing demands from the businessReliance on technology for business-critical operationsAlways-available, anywhere
Increasing complexityAdding capabilities adds management burden80% of IT cost is managing existing systems
Trends of the future magnify challengesMove to Datacenters – large scale, virtualization remote managementOutsourcing – lower skilled, high turnover users
Windows Server 2008 R2 Streamlined Management Scenarios
•PowerShell: Universal Code Execution Model, GUI over PowerShell, Production Scripting•WMI: Discoverability through PS, Profile discovery, CIM update•WS-Man: Remote Shell, Support for hosted environments (Web proxy traversal, Federated Auth using Live ID), Hardware Management (out-of-band management in-band with OS), Resource management•BITS: Lightweight server•PS cmdlets across all!
Datacenter Automation
•Known fact: most customers do not perform in-place upgrade•Migration is a complex problem – both from technical and process perspective•WS7 – pragmatic approach – focus on understanding the problem and building foundation•Goal: consistent documentation across all roles, Stretch: scriptable solution for core roles •Lays foundation for more complete and richer solution in the future
Server Migration
•Server Manager creates consistency and enables integration•Goal: Further improve Server Manager, adding incremental value•Key features: PS cmdlets to add/remove roles/features, remoting, Best Practice Analyzers•Incubating next-gen UX – Active Directory User Management
Rich Server Management
Server Manager & PowerShell Integration
Server Manager PowerShell Cmdlets:Get-WindowsFeatureAdd-WindowsFeatureRemove-WindowsFeature
Leverages PowerShell features/reachRicher command line experience (auto-completion, wildcards, object pipeline, etc)RemotingAvailability on Server Core
PowerShell
• 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
Windows PowerShellNew command-line shell and scripting language
A taste of PowerShell
Using pkgmgr to install Web Server (IIS): start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET; IIS-NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;IIS-FTPPublishingService;IIS-FTPServer;IIS-FTPManagement;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI
Or using Server Manager:Add-WindowsFeature web-server
ORservermanagercmd –install web-server
Exchange 2003 (VBScript) E12 (PowerShell)
Mailbox Statistics
Set listExchange_Mailboxs = GetObject("winmgmts:{impersonationLevel=impersonate}!\\COMPUTERNAME\ROOT\MicrosoftExchangeV2").InstancesOf("Exchange_Mailbox")
For Each objExchange_Mailbox in listExchange_MailboxsWScript.echo "AssocContentCount =” + objExchange_Mailbox.AssocContentCountWScript.echo " DateDiscoveredAbsentInDS =” + objExchange_Mailbox.DateDiscoveredAbsentInDSWScript.echo " DeletedMessageSizeExtended =” + objExchange_Mailbox. DeletedMessageSizeExtendedWScript.echo " LastLoggedOnUserAccount =” + objExchange_Mailbox. LastLoggedOnUserAccountWScript.echo " LastLogoffTime =” + objExchange_Mailbox. LastLogoffTimeWScript.echo " LastLogonTime =” + objExchange_Mailbox. LastLogonTime WScript.echo " LegacyDN =” + objExchange_Mailbox. LegacyDNWScript.echo " MailboxDisplayName =” + objExchange_Mailbox. MailboxDisplayNameWScript.echo " MailboxGUID =” + objExchange_Mailbox. MailboxGUID WScript.echo " ServerName =” + objExchange_Mailbox. ServerName WScript.echo " Size =” + objExchange_Mailbox. SizeWScript.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”
More Productivity
Tower Of PowerPowerShell books
Now available inJapaneseGermanFrenchMore…
2007 2008
Discoverydemo
PowerShell V2 Goals
Reduce the cost and effort to:Use PowerShell
Get, learn, share scriptsLayer applications on PowerShell
GUI, web, workflow, etc.Manage anything/everything
Servers, clients, distributed systems, applications, web services, cloud services, raw HW, other OSes, everythingUsing any and all mechanisms (WMI, .Net, native code, web services, WSMAN)
PowerShell V2 Themes
GUI over PowerShell
Production Scripting
Universal Automation Environment
Community Feedback
Datacenter AutomationPowerShell
GUI over PowerShellAdmin GUIs layered over PowerShellFeatures: Graphical PowerShell, Outgrid View, New Engine APIs, Runspace Pooling, Thread control
Server Role coverage: AD Domain Services, AD Lightweight Directory Services, Application Server, Terminal Services, Web Server
Datacenter AutomationPowerShell
Production Scripting:Scripts are easy to use, share and support and safe to operateFeatures: Script cmdlets, debugger enhancements, restricted language, modules and transactions
Universal Code Execution Model:Flexibility over where/how expressions, Commands & ScriptBlocks can run
On one or more machinesIn restricted or unrestricted environmentsInitiated by user input or by events
Features: Remoting, background jobs, eventing, restricted runspaces, mobile object model
PowerShell Architecture
User Experience
Shell
Language
Debugger
Engine
APIs
Execution Context
Object Mgr
Managed Elements
Cmdlets
WMI
COM
.NET
XML
ADO
ADSI
Native Commands
Admin GUIs layer on top of PowerShellCLI & GUIAgility in delivering new GUIsEnsures automationGUI teaches command lineStandardizes access to managed elements
GUI over PowerShell
PowerShell V2 Themes
User Experience
Shell
Language
Debugger
Engine
APIs
Execution Context
Object Mgr
Managed Elements
Cmdlets
WMI
COM
.NET
XML
ADO
ADSI
Native Commands
GUI Over PowerShell: Features
Graphical PowerShell
Out-Gridview
New APIs
PSSession PoolingThread Control
GUI Over PowerShelldemo
PowerShell V2 Themes
Scripts are Easy to useSafe to operateEasy to shareEasy to support
Production Scripting
User Experience
Shell
Language
Debugger
Engine
APIs
Execution Context
Object Mgr
Managed Elements
Cmdlets
WMI
COM
.NET
XML
ADO
ADSI
Native Commands
Production Scripting: Features
Script Cmdlets
Restricted Language
Modules
Debugger Enhancements
Transactions
Script Cmdlets
Native Code
Production Scriptingdemo
PowerShell V2 Themes
Respond to community feedbackEnhance the languageTweak the engineAdd and enhance Cmdlets
Community Feedback
User Experience
Shell
Language
Debugger
Engine
APIs
Execution Context
Object Mgr
Managed Elements
Cmdlets
WMI
COM
.NET
XML
ADO
ADSI
Native Commands
Community Feedback: Features
Language Enhancement
s
ImprovedObject
Adapters
New Cmdlets
WMI++
PowerShellCommunity.orgHal RottenbergTitleCompany
partner
PowerShellCommunity.org
ForumsBlogsScript RepositoryUser Group Outreach
PowerScripting Podcast
Hosts: Jonathan Walz & Hal RottenbergOnline at PowerScripting.netWeekly dose of News, Resources, Interviews, Tips and more!
Virtual User Group
Marco Shaw runs a monthly user’s group meeting online using Microsoft Live Meeting
InterviewsQ&A with experts
Check news for upcoming events and Marco’s get-powershellblog (marcoshaw.blogspot.com)
PowerShell Newsgroup
Use NNTP server msnews.microsoft.com or web portalGroup name: microsoft.public.windows.powershell
#powershell IRC Chat Room
Freenode IRC network: irc.freenode.netInteractive PowerShell help from experts
Microsoft Resources
PowerShell Team Blog blogs.msdn.com/powershellScripting Guys Script Center microsoft.com/technet/scriptcenter
Hub for official documentationPowerShell Tip of the WeekThe Windows PowerShell ToolboxScript repository and other goodies
Join the Community!
LinkedIn: PowerShell Power UsersTwitter: #powershell hashtagFacebook: PowerScripting Podcast, Windows Powershell Users, The Scripting Guys
And You!
We need your participationIf you blog about PowerShell, let us know!Get on the forums, newsgroups and chat
User Experience
Shell
Language
Debugger
Engine
APIs
Execution Context
Object Mgr
Managed Elements
Cmdlets
WMI
COM
.NET
XML
ADO
ADSI
Native Commands
Universal Automation Features
Remoting
Background Jobs
Eventing
Restricted PSSessions
Mobile Object Model
New Cmdlets (So Far)Remoting:
Invoke-CommandNew-PSSessionGet-PSSessionPush-PSSessionPop-PSSessionRemove-PSSession
Converting Types:Add-TypeConvertTo-CsvConvertFrom-CsvConvertTo-XmlConvertFrom-StringData
Event Viewer and ETW Logs:Get-Event
Script Internationalization:Import-LocalizedData
Modules:Imort-ModuleGet-ModuleRemove-ModuleExport-ModuleMember
Transactions:Complete-TransactionStart-TransactionUndo-TransactionUse-Transaction
Debugging:Set-PSBreakpoint
Get-PSBreakpoint
Enable-PSBreakpoint
Disable-PSBreakpoint
Remove-PSBreakpoint
Get-PSCallStack
Eventing:Register-ObjectEvent
Register-Event
Wait-Event
Remove-Event
Unregister-Event
Get-Event
New-Event
Get-EventSubscriber
Background Jobs:Start-Job
Get-Job
Stop-Job
Receive-Job
Wait-Job
Remove-Job
WMI:Register-WMIEvent Set-WMIInstanceInvoke-WMIMethodRemove-WMIObject
More Cmdlets:Clear-HistoryGet-RandomOut-GridViewSet-StrictModeUpdate-ListWait-Process
ComputerAdd-ComputerCheckpoint-ComputerDisable-ComputerRestoreEnable-ComputerRestoreGet-ComputerRestorePointRemove-ComputerRename-ComputerReset-ComputerMachinePasswordRestart-ComputerRestore-ComputerStop-ComputerTest-ComputerSecureChannel
Hyper-V Automation with Compellent and PowerShell 2.0Shane AndersonCompellent
partner
Verify
Verify
Create HTML Report
Map
V
olu
mes
Windows Server 2008 R2 Hyper-V
Host
Cre
ate
R
ep
lays
Gold Image
Verify
Verify
Automation OverviewVM
Data File
Mou
nt
Volu
mes
C:\VirtualMachines
= ..\TestVM30
= ..\TestVM49
Validate Prerequisite
s
Cre
ate
V
M’s
Start VM’s and Wait for Ready
PowerShell 2.0 Script
More Info Microsoft Alliance Pagehttp://www.compellent.com/microsoft
Powershell Compellent Powershell sitehttp://www.compellent.com/powershell Command Set White Paper http://www.compellent.com/~/media/com/Files/White_Papers/CML_WPS_RR.ashx Windows Live Community Sitehttp://compellentpowershell.groups.live.com/ Powershell Community.orghttp://www.powershellcommunity.org/ Powershell.com http://www.powershell.com
Microsoft and Compellent Joint Customer Webcast “Saving Money while Improving Service availability at Indiana University.”http://www.microsoft.com/virtualization
Summary
The investments in Windows Server 2008 R2 are a significant step towards increasing the manageability of the platform
Expanded PowerShell - available on server coreRemote-able
question & answer
Community ResourcesNewsgroup: Microsoft.Public.Windows.PowerShell
Team blog: http://blogs.msdn.com/PowerShell/
PowerShellCommunity.Org: http://www.PowershellCommunity.Org
Channel 9 http://channel9.msdn.com/tags/PowerShell
Wikihttp://channel9.msdn.com/wiki/default.aspx/Channel9.WindowsPowerShellWiki
Script Center:http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
CodePlex:http://codeplex.com/Project/ProjectDirectory.aspx?TagName=powershell
Many excellent books
Manning Press book by PowerShell Dev Lead Bruce Payette: PowerShell in Action http://manning.com/powershell/
O’Reilly book by PowerShell Dev Lee Holmes – Windows PowerShell Cookbookhttp://www.oreilly.com/catalog/9780596528492/index.html
www.microsoft.com/teched
Sessions On-Demand & Community
http://microsoft.com/technet
Resources for IT Professionals
http://microsoft.com/msdn
Resources for Developers
www.microsoft.com/learningMicrosoft Certification and Training Resources
www.microsoft.com/learning
Microsoft Certification & Training Resources
Resources
Related ContentWSV402 Advanced Windows PowerShell Scripting
DAT314 Manageability Series: Microsoft SQL Server Automation on Steroids, Including PowerShell Support
SIA313 Managing Active Directory Identities with Active Directory PowerShell
WSV325 Windows PowerShell: Tips from the Expert
WCL314 Windows PowerShell for the Windows 7 Enterprise Client
WSV08-HOL Introduction to Windows PowerShell Fundamentals
WSV19-HOL Windows Server 2008 R2: Server Management and PowerShell V2
WSV02-HOL Administering Internet Information Services (IIS) 7.0 by Using Windows PowerShell
Complete an evaluation on CommNet and enter to win!
© 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.