Assign role to user in Scratch Org through sfdx command and send email notification to reset the password

466 Views Asked by At

I have to create users in scratch org through sfdx cli command and assign profile, role to the user.

The command used is

sfdx force:user:create -u <targetusername> -v <targetdevhubusername> [email protected] LastName=testuser1 [email protected] profileName='System Administrator' generatepassword=true

But I want to assign role as well to the user. Tried few ways like Adding parameter to the user create command

UserRole='System Admin'

But its not working.

Can anybody please help me in assigning role to user through sfdx cli.

And once the user is created through Salesforce UI, we have button to Reset Password or checkbox to Generate new password and notify user immediately.

I want to do the same with sfdx cli.

Can anybody help me here. I am stuck since long time.

Thanks in Advance!

0

There are 0 best solutions below