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

Parameters value required
-Admin- first name Magento Admin User’s First Name Yes
-Admin- last name Magento Admin User’s Last Name Yes
-Admin- Email Magento Admin User’s Email Yes
-Admin- User Magento Admin User’s User Yes
-Admin -password Magento 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

Last Update: April 9, 2018  

February 12, 2018   736   Nandini Ramachandran    Start With Magento 2    
Total 1 Votes:

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Leave a Reply

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