# Install Elastic Agent 8.12 via SCCM

**URL:** <https://discuss.elastic.co/t/install-elastic-agent-8-12-via-sccm/352032>\
**Category:** Elastic Agent\
**Created:** [January 29, 2024, 7:30pm UTC](https://discuss.elastic.co/t/install-elastic-agent-8-12-via-sccm/352032 "2024-01-29T19:30:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnatola](https://avatars.discourse-cdn.com/v4/letter/g/4da419/32.png) [@gnatola](https://discuss.elastic.co/u/gnatola)\
**Post date:** [January 29, 2024, 7:30pm UTC](https://discuss.elastic.co/t/install-elastic-agent-8-12-via-sccm/352032/1 "2024-01-29T19:30:21Z")

</div>

Is there a method for installing the Elastic Agent via SCCM? If yes, after installing via SCCM can upgrades be managed in the Fleet page of the Elastic Dashboard? Thank you.

---

<div class="post-metadata">

**Author:** ![strawgate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/strawgate/32/131008_2.png) [@strawgate](https://discuss.elastic.co/u/strawgate)\
**Post date:** [January 29, 2024, 8:34pm UTC](https://discuss.elastic.co/t/install-elastic-agent-8-12-via-sccm/352032/2 "2024-01-29T20:34:56Z")

</div>

You will want to use the ZIP installer for Elastic Agent, extract it to a folder, then use a "script installer" in SCCM and provide command line instructions as specified in the Fleet UI in the "Add Agent" workflow.

You will want to pass command line arguments along the lines of `install --non-interactive --url=URL --enrollment-token=UseYourOwnToken` to the elastic-agent.exe in the root of the expanded installer package. Again, these can be obtained via the "Add Agent" workflow in Fleet UI.

 ![Screenshot 2024-01-29 at 2.35.49 PM](https://us1.discourse-cdn.com/elastic/original/3X/0/1/01b9be352c43e9ac975536621c1bf38dd6c22396.png)

 ![Screenshot 2024-01-29 at 2.36.41 PM](https://us1.discourse-cdn.com/elastic/original/3X/c/0/c0e7b74f668192a0e90fde5db54378c8003e04f2.png)

For detection method, you can then use a "file" on disk pointing to a file in `Program Files\Elastic\Agent` or anything else you desire.

Once you install via SCCM you can indeed manage upgrades via the Fleet UI.

Edit: update per the comment from @leandrojmp

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [January 29, 2024, 8:45pm UTC](https://discuss.elastic.co/t/install-elastic-agent-8-12-via-sccm/352032/3 "2024-01-29T20:45:00Z")

</div>

> [@strawgate](#):
>
> You will want to pass command line arguments along the lines of `install -f --url=URL --enrollment-token=UseYourOwnToken`

I would remove the `-f` since this will force the agent to enroll again with a different id each time the command is run.

Also, if I'm not wrong, for automations you should use the `--non-interactive` argument.

We have an automation like this, but for linux systems.

---

<div class="post-metadata">

**Author:** ![strawgate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/strawgate/32/131008_2.png) [@strawgate](https://discuss.elastic.co/u/strawgate)\
**Post date:** [January 29, 2024, 8:55pm UTC](https://discuss.elastic.co/t/install-elastic-agent-8-12-via-sccm/352032/4 "2024-01-29T20:55:55Z")

</div>

Good call, updated my comment.

---

<div class="post-metadata">

**Author:** ![gnatola](https://avatars.discourse-cdn.com/v4/letter/g/4da419/32.png) [@gnatola](https://discuss.elastic.co/u/gnatola)\
**Post date:** [January 30, 2024, 5:21pm UTC](https://discuss.elastic.co/t/install-elastic-agent-8-12-via-sccm/352032/5 "2024-01-30T17:21:41Z")

</div>

Hello,

Thank you for the information. Is there a way to define the policy from the command line? Or will we have to go into Fleet and assign the policy manually to each endpoint after the agent is installed?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [January 30, 2024, 7:47pm UTC](https://discuss.elastic.co/t/install-elastic-agent-8-12-via-sccm/352032/6 "2024-01-30T19:47:02Z")

</div>

> [@gnatola](#):
>
> Is there a way to define the policy from the command line?

It is the `--enrollment-token` argument, you just need to get the token for the policy you want to use.

You can do that by going into the policy and clicking Add Agent, so it will show you the steps and you can copy the token.

---

<div class="post-metadata">

**Author:** ![gnatola](https://avatars.discourse-cdn.com/v4/letter/g/4da419/32.png) [@gnatola](https://discuss.elastic.co/u/gnatola)\
**Post date:** [January 31, 2024, 2:17pm UTC](https://discuss.elastic.co/t/install-elastic-agent-8-12-via-sccm/352032/7 "2024-01-31T14:17:00Z")

</div>

Leandro,

Thanks again for the information. I know how to proceed now.

---

<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:** [February 28, 2024, 2:17pm UTC](https://discuss.elastic.co/t/install-elastic-agent-8-12-via-sccm/352032/8 "2024-02-28T14:17:33Z")

</div>

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