Installation on Windows server

Security policy on the Windows server 2012 is not allowing the Metricbeat to be installed as a service.

We could alter execution policy to "Bypass" for Process and Localmachine but could not alter for other process. after the changes on follwing the installation instrctions, we are getting the below error.

Could some one help with a workaround to get the Metricbeat installed on the windows server.

Below is the security policy from the machine:
PS C:\WINDOWS\system32> Get-ExecutionPolicy -List

                                                  Scope                                             ExecutionPolicy
                                                  -----                                             ---------------
                                          MachinePolicy                                                RemoteSigned
                                             UserPolicy                                                RemoteSigned
                                                Process                                                   Bypass
                                            CurrentUser                                                   Undefined
                                           LocalMachine                                                      Bypass

Error Message:
PS D:\Metricbeat> .\install-service-metricbeat.ps1
.\install-service-metricbeat.ps1 : File D:\Metricbeat\install-service-metricbeat.ps1 cannot be loaded. The file
D:\Metricbeat\install-service-metricbeat.ps1 is not digitally signed. You cannot run this script on the current
system. For more information about running scripts and setting execution policy, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1

  • .\install-service-metricbeat.ps1
  •   + CategoryInfo          : SecurityError: (:) [], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess

Run Set-ExecutionPolicy RemoteSigned and then try to install.

Tried to install after setting the execution policy, still facing the same issues. Executed the PS as admin and then executed the below commands:

PS D:\Metricbeat> Set-ExecutionPolicy RemoteSigned

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
http://go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
PS D:\Metricbeat> PowerShell.exe -ExecutionPolicy RemoteSigned -File .\install-service-metricbeat.ps1
File D:\Metricbeat\install-service-metricbeat.ps1 cannot be loaded. The file
D:\Metricbeat\install-service-metricbeat.ps1 is not digitally signed. You cannot run this script on the current
system. For more information about running scripts and setting execution policy, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo : SecurityError: (:slight_smile: [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess

Then maybe try this Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass. This command sets the execution policy to bypass for only the current PowerShell session.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.