Manage Windows Server remotely in PowerShell with PSSession

Introduction

In this tutorial, we will see how to remotely administer a Windows server in PowerShell (Powershell remoting) with PSSession.

PSSession is the prefix of several Powershell commands that allow connection and management of it.

All the commands in this tutorial are to be done with a PowerShell command prompt

Prerequisites

On the server where you want to connect, remote management must be enabled.

Remote administration

By default, remote management is enabled by default since Windows 2012.

Connect to a server

With the current user:

By specifying the user:

An identification window opens where you must indicate the password of the account passed as a parameter.

Once logged into the console, the name of the server in square brackets appears first.

Now all the DOS and PowerShell commands will be executed on the remote server.

Example: View installed roles and features.

Disconnect

To disconnect from the server, enter the following command:

Lists of commands * -PSSession

From a command prompt enter:

Show help:

Troubleshooting

Check the WinRM service

Enable remote management in PowerShell

View WinRM configuration

Allow administration from any remote host

This command is useful for non-domain hosts because even if Remote Management is enabled, no hosts are allowed to connect.





Related Posts


Create an Active Directory environment in PowerShell

Table Of ContentsIntroductionPrerequisitesInstalling the AD DS roleCreating the Active Directory domaincomplements Introduction In this tutorial, we will see how to create an Active Directory environm

Jenkins: centralizing the management of scheduled tasks

Jenkins is a free open source software for continuous integration. It is normally used by development equipment to ensure non-regression of source code. In turn, it is possible to use Jenkins as a sch

Admin Center: installation in gateway mode

SummaryIntroPrerequisitesAdmin Center InstallationUse the Admin CenterAdd a server in the Admin CenterAdd an extensionConclusion Intro In this tutorial, we will see how to install the Admin Center in