How to exploit all commands in Magento 2 CLI (Part 7)

In this articles we discuss on Magento 2 Command lines (CLI)

(Part 7): construct an Admin User

Everyone knows Magento 2 have offered the influential command-line interface tool (CLI). It permits you to execute tasks containing installation, configuration, database backups, compiling LESS etc.

Here I will show you how to construct admin use using commands line.

The following steps show you how to add all commands in magento 2 CLI

  1. construct new admin user
  2. Unfasten an admin user

Step 1: construct new admin user

Several times you can modify the permission of your administrator account. Then there is no good admin user in your Magento store. You also have no permission to create a new one. In this situation you can use Magento CLI. To avoid this following command permits you to construct a new admin user in your Magento Store.

php bin/magento admin:user:create [–<parameter_name>=<value>, …]

The following tabulation show you parameters and values

-Admin- first nameMagento Admin User’s First NameYes
-Admin- last nameMagento Admin User’s Last NameYes
-Admin- EmailMagento Admin User’s EmailYes
-Admin- UserMagento Admin User’s UserYes
-Admin -passwordMagento Admin User’s Password

The password should be atleast 7 characters in length and should contain atleast one alaphabetic and atleast one numeric character.

  •  Try to use the following command

Unfasten an Admin User

  • The following command will unlock an admin user
php bin/magento admin:user:unlock {user name}
  • Unlock user ‘Admin’
php bin/magento admin:user:unlock admin
  • If success, you got message below

The user account “admin” has been unlocked

  • Or else, you got message below

The user account “admin” was not locked or cannot be unlocked

These are the following steps shows you how to add all commands in Magento 2 CLI






Leave a Reply

Your email address will not be published. Required fields are marked *