Starting a Remote Session Answer
Full-Access Members Only
Sorry, this lesson is only available to Server Academy Full-Access members. Become a Full-Access member now and get instant access to this and many more premium courses. Click the button below and get instant access now.
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.
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
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.