about_remote_jobs.help

about_remote_jobs.help - TOPIC about_Remote_Jobs SHORT...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 TOPIC about_Remote_Jobs SHORT DESCRIPTION Describes how to run background jobs on remote computers. DETAILED DESCRIPTION A background job is a command that runs asynchronously without interacting with the current session. The command prompt returns immediately, and you can continue to use the session while the job runs. By default, background jobs run on the local computer. However, you can use several different procedures to run background jobs on remote computers. This topic explains how to run a background job on a remote computer. For information about how to run background jobs on a local computer, see about_Jobs. For more information about background jobs, see about_Job_Details. REMOTE BACKGROUND JOBS You can run background jobs on remote computers by using three different methods. -- Start an interactive session with a remote computer, and start a job in the interactive session. The procedures are the same as running a local job, although all actions are performed on the remote computer. -- Run a background job on a remote computer that returns its results to the local computer. Use this method when you want to collect the results of background jobs and maintain them in a central location on the local computer. -- Run a background job on a remote computer that maintains its results on the remote computer. Use this method when the job data is more securely maintained on the originating computer. START A BACKGROUND JOB IN AN INTERACTIVE SESSION You can start an interactive session with a remote computer and then start a background job during the interactive session. For more information about interactive sessions, see about_Remote, and see Enter-PSSession. The procedure for starting a background job in an interactive session is almost identical to the procedure for starting a background job on the local computer. However, all of the operations occur on the remote computer, not the local computer.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 STEP 1: ENTER-PSSESSION Use the Enter-PSSession cmdlet to start an interactive session with a remote computer. You can use the ComputerName parameter of Enter-PSSession to establish a temporary connection for the interactive session. Or, you can use the Session parameter to run the interactive session in a Windows PowerShell session (PSSession). The following command starts an interactive session on the Server01 computer. C:\PS> Enter-PSSession -computername Server01 The command prompt changes to show that you are now connected to the Server01 computer. Server01\C:> STEP 2: START-JOB To start a background job in the session, use the Start-Job cmdlet. The following command runs a background job that gets the events in the Windows PowerShell event log on the Server01 computer. The Start-Job cmdlet returns an object that represents the job. This command saves the job object in the $job variable.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

about_remote_jobs.help - TOPIC about_Remote_Jobs SHORT...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online