PowerShell 2 remoting
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

PowerShell 2 remoting

on

  • 3,113 views

 

Statistics

Views

Total Views
3,113
Views on SlideShare
2,908
Embed Views
205

Actions

Likes
1
Downloads
45
Comments
0

2 Embeds 205

http://www.jonathanmedd.net 200
http://static.slidesharecdn.com 5

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

PowerShell 2 remoting Presentation Transcript

  • 1. PowerShell 2.0 remotingUK PowerShell User Group
    Jonathan Medd
  • 2. I have a dream...........
  • 3. Ben Pearce, Microsoft PFE, gave me that dream in Oct 2008.......
  • 4. ......and now that dream has come true!
    PowerShell Remoting is here and I can manage my entire Windows estate from the comfort of my Home Cinema.
  • 5. PowerShell 2.0 – New Cmdlets with Remoting Functionality
    PowerShell 1.0 only had Get-WmiObject -Computername
    PowerShell 2.0 has 35 cmdlets with ComputerNameparamter
    Examples: Get-Service, Restart-Computer, Write-EventLog
    Use protocols such as RPC & DCOM
    Find them with Get-Command | Where-Object {$_.definition -match 'computername'}
  • 6. Software Requirements for Full-Fat Remoting
    • Typically HTTP on port 5985, open for WinRM 2.0. HTTPS on (5986)
    PowerShell 2.0 and WinRM 2.0
    So either:
    Windows Server 2008 R2 or Windows 7
    Windows Server 2003 or Windows XP and later with the Windows Management Framework Installed which includes PowerShell 2.0 and WinRM 2.0
  • 7. Enable-PSRemoting
    Run as administrator
    Confirmation of changes
  • 8. Additional Requirements if in Workgroup not Domain
    If OS is XP then set Network Access: Sharing and Security Model for local accounts)to Classic.
    Then, for any Windows Operating System, including Windows XP, you will need to add the names of the remote computer(s) into the TrustedHosts setting of WinRM
    Set-Item WSMan:localhostClientTrustedHosts-valueServerName
  • 9. Enable via Group Policy
    Allow automatic configuration of listeners
    Computer ConfigurationPoliciesAdministrative TemplatesWindows ComponentsWindows Remote ManagementWinRM Service
  • 10. Manual Firewall Settings
    Enable Windows Remote Management
  • 11. Interactive PowerShell Remoting
    Enter-PSSession –ComputerNameServer01
    Similar to Telnet / SSH
    Kerberos authentication by default, encryption can be added with SSL
    Exit-PSSession when finished. Session is torn down at this point
  • 12. Interactive PowerShell Remoting Demo
  • 13. If we stopped at this point even this interactive story would be great……..
    30 years of catch-up on remote command line management
  • 14. Persistent PowerShell Remoting
    SSH is so 2007.....
  • 15. Persistent PowerShell Remoting
    Let’s create multiple sessions and store them in a variable $sessions
    $sessions = New-PSSession –ComputerName (Get-Content Servers.txt)
    Can be accessed by cmdlets like Enter-PSSession or Invoke-Command
    Are maintained after the session has been used, until timeout period expired
  • 16. Basic Session Options
    New-PSSession Parameters:
    -Credential: e.g. Domain01User01
    -Name: a friendly name to refer to them with
    -Port: alternate port number to use
    -ThrottleLimit: max number of outbound sessions from this command, 32 by default
    Other parameters are available, check Get-Help!
  • 17. Advanced Session Options
    New-PSSessionOption Parameters:
    -IdleTimeout: Default is 4 mins
    -OpenTimeout
    -OperationTimeout
    -NoCompression
    Other parameters are available, check Get-Help!
    Used via New-PSSession -SessionOption
  • 18. Advanced Session Options Set at the Destination
    Register-PSSessionConfiguration
    Create customised session configurations to present to remote connections.
    -StartupScript: most interesting parameter
    Used via New-PSSession -ConfigurationName
  • 19. Using Persistent Sessions
    Invoke-Command –Session $sessions –ScriptBlock {Get-Culture}
    Note the PSComputerName Property returned
    Invoke-Command –Session $sessions –FilePath C:ScriptsQueryServer.ps1
    You can now run any existing script against all your remote servers
  • 20. If you’re using Windows and not retiring in the next 12 – 18 months, you need to learn PowerShell!
  • 21. Implicit PowerShell Remoting
    Use Management Tools from remote servers on your client workstation
    No need to install modules locally
    Import-PSSession –Session $session –Module ActiveDirectory
    All cmdlets from Active Directory module now available on local workstation
  • 22. Obligatory Cloud Slide
    Exchange Online (BPOS)
    $LiveCred = Get-Credential
    $Session = New-PSSession -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
    Import-PSSession $Session
    A Cloud Service Provider can supply you with the tools you need to manage their service with no local installation required
  • 23. Links
    Simple-Talk Article http://www.simple-talk.com/sysadmin/powershell/new-remoting-features-in-powershell-2.0/
    Administrators Guide to PowerShell Remoting http://powershell.com/cs/media/p/4908.aspx
    Layman’s Guide to PowerShell Remoting http://www.ravichaganti.com/blog/?p=1305