# Login to Auth0 CLI with Powershell

**URL:** <https://community.auth0.com/t/login-to-auth0-cli-with-powershell/80040>\
**Category:** Get Help\
**Tags:** cli\
**Created:** [March 17, 2022, 12:37am UTC](https://community.auth0.com/t/login-to-auth0-cli-with-powershell/80040 "2022-03-17T00:37:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blissitte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/blissitte/32/34247_2.png) [@Blissitte](https://community.auth0.com/u/Blissitte)\
**Post date:** [March 17, 2022, 12:37am UTC](https://community.auth0.com/t/login-to-auth0-cli-with-powershell/80040/1 "2022-03-17T00:37:44Z")

</div>

We have a process where creating an organization requires the creation of a database on our end, the storage of the orgId and so forth. Ideally we would like to create a Powershell script that uses the Auth0 CLI to create the orgs (already tested in regular command prompt) retrieve the orgId and use it to create the databases and update our tracking database with the orgId and orgName. I have encountered difficulty logging in through the CLI through Powershell. Powershell does not want to open the browser window, and using the `auth0.exe login --force --no-input` command just scrolls the `Waiting for login to complete in browser...` message. Is there a way to automate the login through the CLI, or barring that is there a better way of automating some management functions in a scripting environment like Powershell?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 17, 2022, 8:18pm UTC](https://community.auth0.com/t/login-to-auth0-cli-with-powershell/80040/3 "2022-03-17T20:18:35Z")

</div>

Hi @Blissitte,

I think the Auth0 CLI is meant to be a user-centric application, which may or may not work for this situation. You could try to log in manually with `auth0 login`, which should store a refresh token for later use.

If that doesn’t work, you may want to look into using the [Deploy CLI Tool](https://auth0.com/docs/deploy-monitor/deploy-cli-tool), which authenticates as a user-less Machine to Machine application in Auth0.

Let me know if you have questions.

---

<div class="post-metadata">

**Author:** ![Blissitte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/blissitte/32/34247_2.png) [@Blissitte](https://community.auth0.com/u/Blissitte)\
**Post date:** [March 18, 2022, 12:18am UTC](https://community.auth0.com/t/login-to-auth0-cli-with-powershell/80040/4 "2022-03-18T00:18:54Z")

</div>

Is the Auth0-Deploy-CLI for making modifications to a tenant or for replicating tenants? It looks like the latter.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 18, 2022, 4:42pm UTC](https://community.auth0.com/t/login-to-auth0-cli-with-powershell/80040/5 "2022-03-18T16:42:24Z")

</div>

It can do either one, that’s why I recommended it. 😄

Make sure you have `"AUTH0_ALLOW_DELETE": false` in your config file to prevent destruction of your existing tenant settings/entities.

Then just pass a single org in your tenant yaml.

```auto
organizations:
  - name: "test-org"

```

I would suggest testing it out on a temporary or test tenant to make sure you understand how everything is working.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 22, 2022, 12:02am UTC](https://community.auth0.com/t/login-to-auth0-cli-with-powershell/80040/6 "2022-04-22T00:02:20Z")

</div>


