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


2 comments:

  1. Montblanc MeisterstückClassique black ballpoint pen with gold accessories replica mont blanc uk is one of the most famous Montblanc fountain pens replica mont blanc donation pens and is considered one of the writing instruments. The design icon has a white snow cap insignia and has its own personal serial number, which means that the pen you own will be unique. Montblanc ballpoint pens are a must-have Montblanc ballpoint pens, popular with gift buyers, corporate customers and serious pen collectors. The smoothness of the ballpoint pen mechanism makes writing luxurious and enjoyable.

    ReplyDelete
  2. Ducky Luck knocks it out of the park with a large welcome bonus that's sure to turn some heads. When you sign up and make your first deposit, you can to|you presumably can} opt-in for Ducky Luck’s huge welcome casino bonus of 500% match up to as} $2,500. On prime of that positively monstrous match bonus, you’ll get 50 bonus spins per day for three days. That’s why we’ve dug deep into the web and pulled up 9 of the easiest free spins casino bonuses the net casino trade has to supply. 룰렛 Play Now Sail away into a tropical new variation on conventional five-card stud poker. In this steamy poker sport, the vendor should qualify with an Ace and King or a pair or higher.

    ReplyDelete