# How to reconnect ActiveGate via command prompt/powershell in windows

**URL:** <https://community.dynatrace.com/t/how-to-reconnect-activegate-via-command-prompt-powershell-in-windows/47009>\
**Category:** Open Q&A\
**Tags:** installation, activegate, services-classic, hosts-classic\
**Created:** [August 5, 2024, 4:06pm UTC](https://community.dynatrace.com/t/how-to-reconnect-activegate-via-command-prompt-powershell-in-windows/47009 "2024-08-05T16:06:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manohar\_expert](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@Manohar\_expert](https://community.dynatrace.com/u/Manohar_expert)\
**Post date:** [August 5, 2024, 4:06pm UTC](https://community.dynatrace.com/t/how-to-reconnect-activegate-via-command-prompt-powershell-in-windows/47009/1 "2024-08-05T16:06:20Z")

</div>

I installed OneAgent along with activegate, after sometime ActiveGate has been disabled automatically and showing as direct connection, I’ve tried reconnecting ActiveGate but no luck, Need support regarding this.

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [August 6, 2024, 6:06am UTC](https://community.dynatrace.com/t/how-to-reconnect-activegate-via-command-prompt-powershell-in-windows/47009/2 "2024-08-06T06:06:01Z")

</div>

Is the ActiveGate actually running ? Can you please try restarting and see if that helps

> **[Start/stop/restart ActiveGate](https://docs.dynatrace.com/docs/ingest-from/dynatrace-activegate/operation/stop-restart-activegate)**
>
> Learn how you can start, stop and restart ActiveGate on Windows or Linux.

---

<div class="post-metadata">

**Author:** ![Manohar\_expert](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@Manohar\_expert](https://community.dynatrace.com/u/Manohar_expert)\
**Post date:** [August 6, 2024, 12:34pm UTC](https://community.dynatrace.com/t/how-to-reconnect-activegate-via-command-prompt-powershell-in-windows/47009/3 "2024-08-06T12:34:03Z")

</div>

Hi&nbsp;[@p\_devulapalli](https://community.dynatrace.com/user/21657),

Earlier OneAgent is connected with ActiveGate and is working fine, later Activegate got disconnected due to server shutdown. After that I started the server and ActiveGate got enabled but OneAgent is not connecting with the ActiveGate. I’ve restarted OneAgent service and server but no luck

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [August 7, 2024, 12:52am UTC](https://community.dynatrace.com/t/how-to-reconnect-activegate-via-command-prompt-powershell-in-windows/47009/4 "2024-08-07T00:52:26Z")

</div>

Well there could be different reasons for that and needs some troubleshooting, you can try some of the below options

> **[OneAgent configuration via command-line interface](https://docs.dynatrace.com/docs/ingest-from/dynatrace-oneagent/oneagent-configuration-via-command-line-interface)**
>
> Learn how to perform some OneAgent configuration tasks without the need to reinstall OneAgent.

Try telnet to the AG from oneagent and see if you are able to connect on 9999

Check your network zones if any

---

<div class="post-metadata">

**Author:** ![MostafaHussein](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mostafahussein/32/2785_2.png) [@MostafaHussein](https://community.dynatrace.com/u/MostafaHussein)\
**Post date:** [August 7, 2024, 7:29am UTC](https://community.dynatrace.com/t/how-to-reconnect-activegate-via-command-prompt-powershell-in-windows/47009/5 "2024-08-07T07:29:02Z")

</div>

1. check if the activegate is running from both deployment status & from the AG server itself by running `net start “Dynatrace gateway”

2. check if both OneAgent and Activegate has the same network zone or not

3. check the port 9999 on activegate from the OneAgent server you can use telnet or curl for this, if not able to connect check these files `conf.properties` and `custom.properties` located in this directory `C:\ProgramData\dynatrace\gateway\config`

---

<div class="post-metadata">

**Author:** ![PierreGutierrez](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pierregutierrez/32/5934_2.png) [@PierreGutierrez](https://community.dynatrace.com/u/PierreGutierrez)\
**Post date:** [August 11, 2024, 1:32am UTC](https://community.dynatrace.com/t/how-to-reconnect-activegate-via-command-prompt-powershell-in-windows/47009/6 "2024-08-11T01:32:59Z")

</div>

Hello&nbsp;[@Manohar\_expert](https://community.dynatrace.com/user/79055)&nbsp;  
The steps that [@MostafaHussein](https://community.dynatrace.com/user/66935)&nbsp; indicates are very good !.  
Especially the 2nd one, since the best way to “direct and ensure” that a oneAgent takes a specific ActiveGate is through the **network Zone.**

However, answering your main question, the commands that you can use to restart an ActiveGate are:

in Prompt (administrator permissions)

Start ActiveGate

- Prompt:

```markup
net start "Dynatrace Gateway"

```

- PowerShell :

```markup
Start-Service -Name "Dynatrace Gateway"

```

Stop ActiveGate

- Prompt:

```markup
net stop "Dynatrace Gateway"

```

- PowerShell :

```markup
Stop-Service -Name "Dynatrace Gateway"

```

I hope it is useful for you 💪
