From the course: PowerShell for SQL Server Administration

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Ending a remote session

Ending a remote session - PowerShell Tutorial

From the course: PowerShell for SQL Server Administration

Start my 1-month free trial

Ending a remote session

- [Instructor] So once we're in a remote session, you need to know how to get out of that remote session. So getting out of remote session is actually fairly straightforward. We use the Exit-PSSession cmdlet to end that remote session, and that'll drop us back to our normal PowerShell window on our local box. So, we can see what server we're connected to when we enter the session, 'cause it's going to have the name of the server. You can also see every time we issue a command on that remote machine. We're going to see the name of that remote machine at the front of our command. It's going to be labeled this dc01, in this case, 'cause that's the name of the machine we're connecting to. So we issue all our various commands on that box, in this case, we're just doing a dir, and then we do our Exit-PSSession, and we drop back to our normal PS SQL and backslash prompt. We can tell what server we're on, we can tell that…

Contents