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.
Open PowerShell, make sure you have created a local profile, and set your remote execution policy to RemoteSigned.
Enter Notepad $profile.
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
Save the profile in Notepad.
Close the existing PowerShell session.
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.