0%

0/1 Lessons

Course Introduction

• 5min

0 / 2 lessons complete

Getting Started with Windows PowerShell

• 56min

0 / 8 lessons complete

Getting Help and Finding Commands

• 39min

0 / 6 lessons complete

PowerShell Command Syntax

• 33min

0 / 5 lessons complete

PowerShell Objects and Properties

• 35min

0 / 6 lessons complete

The PowerShell Pipeline

• 24min

0 / 2 lessons complete

PowerShell Providers

• 30min

0 / 5 lessons complete

PowerShell Arrays and Variables

• 28min

0 / 4 lessons complete

PowerShell Loops

• 19min

0 / 3 lessons complete

PowerShell Conditional Statements

• 11min

0 / 1 lessons complete

On Premises Lab Setup

• 36min

0 / 8 lessons complete

Basic Domain Administration with Windows PowerShell

• 2hr 27min

0 / 10 lessons complete

Send Emails with PowerShell

• 22min

0 / 2 lessons complete

PowerShell Desired State Configuration (DSC) Basics

• 1hr 48min

0 / 6 lessons complete

PowerShell Modules

• 58min

0 / 7 lessons complete

Powershell Challenges

• 1hr 55min

0 / 23 lessons complete

Course Conclusion

• 1min

0 / 1 lessons complete

Starting a Remote Session Answer

Instructions

Q&A (0)

Notes (0)

Resources (0)

Saving Progress...

Resources

There are no resources for this lesson.

Notes can be saved and accessed anywhere in the course. They also double as bookmarks so you can quickly review important lesson material.

Create note

03 (Answer) Starting a Remote Session

From the Host computer open Virtual Studio Code (VSC)
Again, this is not a VSC course,
but I will show you a few things about VSC, enough to pique your interest so that you will explore and learn more. At the end of this lesson, I have a link, check it out!

On the left, notice that I have all my scripts listed for easy access, I’ll show you how to do this:
From the Host computer I created a folder called VSC scripts. An easy way to create a script is to open any txt editor, paste your script and rename the file .ps1. Now from File, Open Folder, choose your folder and there you go, access to all your scripts. If you want you can stop the video now and create your folder structure, or just move along with our Remote Session.

From the student guide copy and paste this command into the Terminal section of VSC.

Here's the command:
Enter-pssession -computername vsc1 -credential administrator  
 You may need to enable the administrator account.
To check your administrator account open virtual box or hyper-v and start your VM called VSC1 – Stop the video while you do this.

(From VSC1, use Computer Management, Local users and groups, users, Administrator, uncheck Account is disabled) By default the local Administrator account is disabled.

Here is the explanation:

  • This command is used to establish a remote PowerShell session (PSSession) with a computer named "VSC1" using the "administrator" credentials. Let's break it down step by step:
  • Enter-PSSession: This is a PowerShell cmdlet that is used to start an interactive remote PowerShell session. It allows you to establish a connection to a remote computer and work with it as if you were sitting in front of it. Once the session is established, you can execute commands on the remote computer.
  • -ComputerName VSC1: This part of the command specifies the target computer to which you want to connect. In this case, "VSC1" is the name of the remote computer you want to access. You can replace "vsc1" with the actual name or IP address of the remote computer you want to connect to.
  • -Credential administrator: Here, you provide the credentials that you want to use to authenticate and establish the remote session. In this example, it specifies "administrator" as the username. You will need to enter the corresponding password for the "administrator" account when prompted. This is necessary to ensure that you have the necessary permissions to access the remote computer.

  • When you run this command, PowerShell will attempt to establish a remote session with the specified computer ("VSC1" in this case) using the provided credentials ("administrator" account). Once the session is successfully established, you will be able to interact with the remote computer's PowerShell environment, run commands, and manage it remotely. This is especially useful for system administration tasks on remote machines.
  • From VSC to run this command, I press 1, then press F8. Credential request  comes up, I enter the password, Press Ok. And now I am in a remote session with VSC1. To exit the session, I type exit-pssession then press return.
  • If you are having difficulties remoting into your VM check out the last lecture named PSRemoting Troubleshooting – Possible fixes

https://code.visualstudio.com/docs/introvideos/basics

Server Academy Members Only

Sorry, this lesson is only available to Server Academy Full Access members. Become a Full-Access Member now and you’ll get instant access to all of our courses.

0 0 votes
Lesson Rating
Subscribe
Notify of
profile avatar