Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

APPENDIX A: Solutions to Exercises > Solution 6: Set Up a Remote PowerShell Ses...

Solution 6: Set Up a Remote PowerShell Session

This exercise is all about leveraging the power of profiles, which you learned about in Chapter 3. You can place the New-PSSession cmdlets for the servers inside the profile.

  1. Open PowerShell, make sure you have created a local profile, and set your remote execution policy to RemoteSigned.
  2. Enter Notepad $profile.
  3. Use the New-PSSession cmdlet followed by the server names you want to manage. If you wanted to connect remotely to Server2 and Server3, for example, the cmdlet would look as follows:
    New-PSSession Server2, Server3
  4. Save the profile in Notepad.
  5. Close the existing PowerShell session.
  6. Reopen the PowerShell session, and verify the remote sessions are created. You can verify the sessions with the Get-PSSession cmdlet.

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint