Monday, January 20, 2014

Microsoft Virtual Academy: PowerShell M08

To start your own learning check out Microsoft Virtual Academy:
(rewritten based on my notes available here:

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

  • Remoting
  • Sessions
  • Remote CMDLETs
  • Measure execution speed

    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.


    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:
 Id       Name            ComputerName    State         ConfigurationName         Availability
 --        ----                  ------------                  -----            -----------------                        ------------
  4       Session4      cutie                        Opened     Microsoft.PowerShell     Available
  5       Cutie             cutie                         Opened     Microsoft.PowerShell     Available

Enabling Remoting

No comments:

Post a Comment