Pre-requisites: Before adding an on-premise farm server

Follow the below pre-requisites for enabling Remote PowerShell on both remote server machine (SharePoint Server) and local machine (where SharePoint Manager Plus is installed)

Perform the below steps on the SharePoint Server Machine: Open the PowerShell as administrator (Check if any Public network connection is available in the machine. If so, change it to Domain or Private and Proceed)
  1. Enable-PSRemoting -Force
  2. Enable-WSManCredSSP -Role Server -Force

Perform the below steps on the Local Machine (where SharePoint Manager Plus is installed): Open the PowerShell as administrator (Check if any Public network connection is available in the machine. If so, change it to Domain or Private and Proceed)
  1. Enable-PSRemoting -Force
  2. Enable-WSManCredSSP -Role Client -DelegateComputer "server.domain.com" (Fully Qualified Domain Name of the Remote server)
  3. Click here to check your Group policy settings.

Commands to increase maximum memory allocated per shell, recommended size is 1024 MB.
  1. Get-Item wsman:\localhost\shell\MaxMemoryPerShellMB (To check the current powershell memory size)
  2. Set-Item wsman:\localhost\shell\MaxMemoryPerShellMB -Value 1024 -Force ( Run this only if memory is less than 1024 MB)
  3. Set-Item wsman:\localhost\Plugin\Microsoft.PowerShell\Quotas\MaxMemoryPerShellMB -Value 1024 -Force ( Run this only if memory is less than 1024 MB)
  4. Restart-Service WinRM

Commands to increase maximum concurrent shells allowed per user, recommended count is 30.
  1. Get-Item wsman:\localhost\shell\MaxShellsPerUser (To check the maximum concurrent shells allowed per user)
  2. Set-Item wsman:\localhost\shell\MaxShellsPerUser -Value 30 -Force ( Run this only if count is less than 30)
  3. Restart-Service WinRM
Note:
In case of remote server and local machine being in different domains, run the below commands in the local machine
  1. Enable-PSRemoting -Force
  2. Set-Item WSMan:\localhost\Client\TrustedHosts -Value "server.domain.com" (Fully Qualified Domain Name of the Remote server) -Concatenate -Force
  3. Restart-Service WinRM


Required Local Group Policy Settings

This group policy settings needs to be done in machine where SharePoint Manager Plus application is installed.

To enable client-side CredSSP to allow user credential delegation for winrm for your target machine in the domain, set the following policy values:

  1. Computer Policy Administrative Templates System Credentials Delegation Allow Delegating Fresh Credentials Set to enabled and add WSMAN/* to list of servers(For eg: WSMAN/mysharepointserver.domain.com), check the box for Concatenate OS defaults with input above
  2. Computer Policy Administrative Templates System Credentials Delegation Allow Delegating Fresh Credentials with NTLM-only server authentication Set to enabled and add WSMAN/* to list of servers(For eg: WSMAN/mysharepointserver.domain.com), check the box for Concatenate OS defaults with input above
  3. Computer Policy Administrative Templates Windows Components Windows Remote Management (WinRM) WinRM Client Allow CredSSP authentication Set to enabled

Checking for proper configuration

Once the above commands are executed successfully, please follow the below steps to check if SharePoint server is reachable from the machine where SharePoint Manager Plus is installed.

Perform the below steps on the Local Machine (where SharePoint Manager Plus is installed): Open the PowerShell as administrator
  1. Enter-PSSession -ComputerName "FQDN_of_SharePoint_Server_name" -Credential "DOMAIN\farm_admin_username" -Authentication CredSSP (Press "Enter" and give password in the prompt opened)
  2. Add-PSSnapin Microsoft.SharePoint.PowerShell
  3. Get-SPFarm
  4. Above command should display the name of the SharePoint Farm you are about to connect and it means successful configuration of the required PowerShell Pre-requisites. Now, you can connect the SharePoint Farm using the SharePoint Manager Plus application via this.
In case running the command "Get-SPFarm" throws the following error, please follow the below mentioned troubleshooting steps to finish the configuration,

Get-SPFarm : Microsoft SharePoint is not supported with version 4.0.30319.33440 of the Microsoft .Net Runtime.
At line:1 char:1
+ get-spfarm
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (Microsoft.Share...SpCmdletGetFarm:SpCmdletGetFarm) [Get-SPFarm], PlatformN otSupportedException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SpCmdletGetFarm

Troubleshooting Steps:

Creating custom PowerShell session configuration

Perform the below steps on the SharePoint Server Machine: Open the PowerShell as administrator,

  1. Register-PSSessionConfiguration -PSVersion 2.0 -Name ps2

Now, open the SharePoint Manager Plus installation location and go to ManageEngine\SharePoint Manager Plus\bin folder,

  1. Open command prompt as administrator at this location and run connectDb.bat
  2. Run the below query in the command prompt window,

    Update ParamValueRelation set VALUE='ps2' where PARAM='PS_CONFIG_DEFAULT';

Adding an on-premise farm server

In the New Farm Details dialog box,

  1. Provide the Fully Qualified Domain Name of the server that is to be added.( Preferably any one of the WFE servers or the server machine where Central web administration is available)
  2. Specify the farm admin credential to add the farm server for monitoring

Note:

Farm Admin Privileges

User account used for configuring the On-Premise Farm server must have the below mentioned privileges

  1. User should be a member of built in administrator group of the remote machine
  2. User should be a member of Farm Administration Group
    Open up Central Web Administration and add the user to the Farm Administrator group if not added previously.
  3. User should have access to all SharePoint databases i.e. SQL Server SharePoint_Shell_Access database role to all SharePoint databases including Configuration database and all content databases.
    To assign this role to User through PowerShell Script, Open the PowerShell in Remote machine and run

    Add-PSSnapin Microsoft.SharePoint.PowerShell
    Get-SPDatabase | Add-SPShellAdmin DOMAIN\UserName [ Replace DOMAIN\UserName with actual User account]


    Or you can do it by opening SQL Server Management Studio, assign the User with DBCREATOR, SECURITYADMIN and SYSADMIN Server Roles. Also, ensure that user has DBOWNER privilege over all the SharePoint databases.
  4. User should have Full Control over all the web applications
    Open up Central Web Administration, under manage web applications section, select each web application and click the user policy option on the top ribbon and add the user with Full Control privilege.

    Or, to assign it through PowerShell Script, run the below script in the Remote machine's PowerShell

    Add-PSSnapin Microsoft.SharePoint.PowerShell
    $user = "DOMAIN\UserName"
    $displayName = "User Display Name"
    Get-SPWebApplication | foreach { `
    $policy = $_.Policies.Add($user,$displayName) `
    $role = $_.PolicyRoles.GetSpecialRole([Microsoft.SharePoint.Administration.SPPolicyRoleType]::FullControl `
    $policy.PolicyRoleBindings.Add($role) `
    $_.Update() `
    }
    Also, ensure the user account have administrator access over all site collections in order to fetch in depth reports about site collections.