# Installation on Windows server

**URL:** https://discuss.elastic.co/t/installation-on-windows-server/97010
**Category:** Beats
**Tags:** metricbeat
**Created:** [August 14, 2017, 6:17pm UTC](https://discuss.elastic.co/t/installation-on-windows-server/97010 "2017-08-14T18:17:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Karthikeyan\_Krishnam](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Karthikeyan\_Krishnam](https://discuss.elastic.co/u/Karthikeyan_Krishnam)
#### Post date: [August 14, 2017, 6:17pm UTC](https://discuss.elastic.co/t/installation-on-windows-server/97010/1 "2017-08-14T18:17:14Z")

</div>

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](http://go.microsoft.com/fwlink/?LinkID=135170).  
At line:1 char:1

- .\install-service-metricbeat.ps1
- 

```auto
  + CategoryInfo : SecurityError: (:) [], PSSecurityException
  + FullyQualifiedErrorId : UnauthorizedAccess
```

---

<div class="post-metadata">

### Author: ![maddin2016](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maddin2016/32/16599_2.png) [@maddin2016](https://discuss.elastic.co/u/maddin2016)
#### Post date: [August 15, 2017, 11:20am UTC](https://discuss.elastic.co/t/installation-on-windows-server/97010/2 "2017-08-15T11:20:14Z")

</div>

Run `Set-ExecutionPolicy RemoteSigned` and then try to install.

---

<div class="post-metadata">

### Author: ![Karthikeyan\_Krishnam](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Karthikeyan\_Krishnam](https://discuss.elastic.co/u/Karthikeyan_Krishnam)
#### Post date: [August 23, 2017, 7:42pm UTC](https://discuss.elastic.co/t/installation-on-windows-server/97010/3 "2017-08-23T19:42:14Z")

</div>

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](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](http://go.microsoft.com/fwlink/?LinkID=135170).  
+ CategoryInfo : SecurityError: (🙂 [], ParentContainsErrorRecordException  
+ FullyQualifiedErrorId : UnauthorizedAccess

---

<div class="post-metadata">

### Author: ![maddin2016](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maddin2016/32/16599_2.png) [@maddin2016](https://discuss.elastic.co/u/maddin2016)
#### Post date: [August 24, 2017, 7:07am UTC](https://discuss.elastic.co/t/installation-on-windows-server/97010/4 "2017-08-24T07:07:28Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 21, 2017, 7:07am UTC](https://discuss.elastic.co/t/installation-on-windows-server/97010/5 "2017-09-21T07:07:44Z")

</div>

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