Monday, January 20, 2014

Microsoft Virtual Academy: PowerShell M08


To start your own learning check out Microsoft Virtual Academy:
(http://www.microsoftvirtualacademy.com/training-courses/getting-started-with-powershell-3-0-jump-start?o=3276#?fbid=aVs9FfAH2DJ)
(rewritten based on my notes available here: https://drive.google.com/file/d/0B1fwreWrAZioWUlmOXVBYlJEWU0/edit?usp=sharing)

Module 8 "Automation in scale: remoting" consists of 2 video segments totaling ≈ 26 minutes along with a PowerPoint of 9 slides.

Overview:
  • Remoting
  • Sessions
  • Remote CMDLETs
  • Measure execution speed
Remoting

    As covered in past module/posts we can execute CMDLETs on remote systems using the Invoke-Command / ICM.  Somethings to understand about this process.


  • When executed command sent to remote system to establish PowerShell session.
    • Involves creating TCP connection, PowerShell session each time the ICM command is used.
  • This is inefficient for many reasons:
    1. Resources wasted to create and tear down PowerShell session on remote system for each ICM execution
    2. Since each ICM is it's own session nothing remains in memory after tear down.  This causes problems for automation.
To get around the limitations and work more efficiently remote PowerShell sessions are allowed.  It allows the remote start of a PowerShell session that will remain alive until closed. This allows for data to be passed through following CMDLETs.



Sessions

    A PowerShell session allows the execution of CMDLETs and usage of local memory for data/variables.  A session can be created by opening local PowerShell shell or through CMDLET New-PSSession (Sessions can be local or remote).

New-PSSession -Computername [DC1]
     Opens new session with remote system (DC1)

To view current live/open sessions we use the following:
Get-PSSession
 Id       Name            ComputerName    State         ConfigurationName         Availability
 --        ----                  ------------                  -----            -----------------                        ------------
  4       Session4      cutie                        Opened     Microsoft.PowerShell     Available
  5       Cutie             cutie                         Opened     Microsoft.PowerShell     Available


Remote CMDLETS
    
Enabling Remoting


3 comments:

  1. replica breitling watches Shop the Swiss timepieces favored by aeronautical enthusiasts with our array of authentic, replica breitling watchespre-owned Breitling watches.

    ReplyDelete
  2. Alexander McQueen is an iconic replica ALEXANDER MCQUEEN Shoes fashion house creatively cheap ALEXANDER MCQUEEN sneaker womens taken over by Sarah Burton who continues to work and evolve with the brand, offering a luxurious range of prêt-à-porter clothing and accessories.

    ReplyDelete
  3. Giuseppe Zanotti was born replica sneakers in San Mauro Pascoli, replica jimmy choo an Adriatic town with a long tradition of shoemaking. He has worked in luxury footwear for women for over twenty years, beginning as a design apprentice before making a name for himself as a footwear designer for Italian and international companies. In 1994, Giuseppe Zanotti decided to try his hand in his own business. There followed a steady rise to distinction which fully justifies the international acclaim he now enjoys.

    ReplyDelete