Professional Documents
Culture Documents
Module Overview
After completing this module, you will be able to:
Start and manage background jobs
local computer
Retrieve the results from a job and work with those results in the
pipeline
Retrieve the results from a job and leave the results cached in
memory
known as synchronously
job object
Background WMI
The Get-WmiObject cmdlet
Managing Jobs
Four important cmdlets are used to manage the list of
running jobs
Get-Job
Remove-Job
Wait-Job
Stop-Job
Job Output
At some point, you need to gather the data from a
variable.
$results = Receive-Job id 2
Retrieving the output of a job also removes that output
You will need to clean up the job list from time to time,
By ID
By Instance ID
By name
By state
Remove-Job id 1
Remove-Job name Job1
Get-Job | Where { $_.Name like "AD*" } | Remove-Job
Logon information
Virtual machine
LON-DC1
LON-SVR1
Contoso\Administrator ContosoAdministrator
Password
Pa$$w0rd
Pa$$w0rd
Lab Scenario
You are a system administrator who has several scripts
already developed.
Lab Review
You have started a PowerShell console and have started a
a background job
to remote computers
remote computer
Batch administration
Lightweight administration
1-to-1 Remoting
WinRM
PowerShell Remoting rides on top of the Windows Remote
environment?
Network challenges?
Security challenges?
Remote Shell
The Enable-PSRemoting cmdlet
Enables WinRM
1-to-1 Shell
The 1-to-1 shell creates a remote command-line prompt
1-to-Many Remoting
1-to-Many Remoting is useful when you need to execute
Pipeline Binding
Recall that some cmdlets bind their pipeline input
Get-ADComputer filter * |
Select
@{Label='ComputerName';Expression={$_.Name}} |
Get-Service name *
Multi-Computer Jobs
Jobs that span across multiple computers create top-level
Restricted Runspaces
Recall: Restricted runspaces are created by developers to
Best Practices
Some best practices
loopback situation
Session Management
Sessions require on-system resources to remain open
Implicit Remoting
The topic of implicit remoting was first introduced in
Module 5.
Logon information
Virtual machine
LON-DC1
LON-SVR1
LON-SVR2
Contoso\Administrator
Contoso\Administrator
Contoso\Administrator
Password
Pa$$w0rd
Pa$$w0rd
Pa$$w0rd
Lab Scenario
You are a system administrator and often need to run
Lab Review
Is there any limit to the number of remote sessions that
can be run?
computer?