# Command to add a user/password on Elastic search

**URL:** <https://discuss.elastic.co/t/command-to-add-a-user-password-on-elastic-search/87165>\
**Category:** Elasticsearch\
**Created:** [May 25, 2017, 5:59pm UTC](https://discuss.elastic.co/t/command-to-add-a-user-password-on-elastic-search/87165 "2017-05-25T17:59:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinuja1](https://avatars.discourse-cdn.com/v4/letter/v/c57346/32.png) [@Vinuja1](https://discuss.elastic.co/u/Vinuja1)\
**Post date:** [May 25, 2017, 5:59pm UTC](https://discuss.elastic.co/t/command-to-add-a-user-password-on-elastic-search/87165/1 "2017-05-25T17:59:24Z")

</div>

In order to ass a new user/password on my elasticsearch, I need to execute the following line :   
curl -XPUT -u elastic 'localhost:9200/\_xpack/security/user/elastic/\_password' -H "Content-Type: application/json" -d '{  
"password" : "elasticpassword"  
}'

Or I can only do it with PowerShell. Does someone know, how I can executed it.  
Thanks  
Regards  
Vinuja

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 25, 2017, 9:51pm UTC](https://discuss.elastic.co/t/command-to-add-a-user-password-on-elastic-search/87165/2 "2017-05-25T21:51:19Z")

</div>

I moved the question to #x-pack

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [May 26, 2017, 12:32am UTC](https://discuss.elastic.co/t/command-to-add-a-user-password-on-elastic-search/87165/3 "2017-05-26T00:32:59Z")

</div>

The user creation process just uses a standard HTTP `PUT`, so you're free to use any tool you like that can perform HTTP requests.

Our documentation provides examples using `curl`, but PowerShell is an option as well. Our [license management docs](https://www.elastic.co/guide/en/x-pack/current/installing-license.html) have an example of using `Invoke-WebRequest` to perform a PUT request on an Elasticsearch server - you could adapt that for your needs.

Alternatively, if you [install Kibana](https://www.elastic.co/downloads/kibana), it provides 2 other options. Kibana with X-Pack provides a full UI for managing users and roles if that suits you, or the _Dev Tools_ console in Kibana can also be used to send requests directly to Elasticsearch. Many of the examples in the documentation provide an "open in Console" link that will allow you to run that example through your local Kibana instance.

Finally, since you are on Windows, there is also a [.NET API](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/index.html) available that provides a straight forward programmatic interface to Elasticsearch, including X-Pack features.

---

<div class="post-metadata">

**Author:** ![Vinuja1](https://avatars.discourse-cdn.com/v4/letter/v/c57346/32.png) [@Vinuja1](https://discuss.elastic.co/u/Vinuja1)\
**Post date:** [May 26, 2017, 12:58pm UTC](https://discuss.elastic.co/t/command-to-add-a-user-password-on-elastic-search/87165/4 "2017-05-26T12:58:12Z")

</div>

Thank you very much to your reply.  
It works.

---

<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:** [June 23, 2017, 12:58pm UTC](https://discuss.elastic.co/t/command-to-add-a-user-password-on-elastic-search/87165/5 "2017-06-23T12:58:32Z")

</div>

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