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.
- Magento 2 CLI overview
- Examine Caches in Magento 2 using CLI
- Examine indexers in Magento 2 using CLI
- Examine modules in Magento 2 using CLI
- Form Magento Store using CLI
- Produce sample data for Performing testing
- Backup and roll back Magento
The following steps show you how to add all commands in magento 2 CLI
- construct new admin user
- 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. | Yes |
- 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