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

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> Username=testuser1#my.org LastName=testuser1 Email=me#my.org 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!

Related

How do I check if a user has administrator permission with discord-oauth2-api?

I am making a web panel for my discord bot with a module called discord-oauth2-api and I can get my perms in the servers as permission code like this: 453223243328 but I don't know what does change if a user has administrator in this code so I can't check if a user has administrator.
For what i found the code: 2147483647 under the voice of "permissions" means that the user in the server has "Administrator" permission (the code can even mean the user is the owner of the server).
You can even find if the user is admin with the voice: "permissions_new" which is: 4398046511103.
Thats what i've found, if you what to know more theres a guide from discord for all the values https://discord.com/developers/docs/topics/permissions

Discord.NET only admins can run this command

i want to make a command in Discord.NET that only can be ran by admins.
It would be great if anyone could give me an example thank you!
A command is basically a message that gets sent to the bot. You simply check if the message sender has a specific role ID. An admin role also has a role ID, if the role ID's match, you continue with the command.

Salesforce x Docusign: could not be activated - [USER_AUTHENTICATION_FAILED] One or both of Username and Password are invalid

I'm using Esignature Salesforce with Docusign, and I when I tried to add a new user to the Docusign by the Salesforce, I'm receiving the follow error:
could not be activated - [USER_AUTHENTICATION_FAILED] One or both of Username and Password are invalid.
This error occurs to some users only.
I saw in the Slaesforce and Docusign log and there is no error appearing on the log.
Is someone know what is happening?
this typically means the Salesforce username/email combination already exists as an active user on the account server they're trying to add them to. They can either a) have those other users on the other accounts closed, or b) In versions 7.2.1+ resolve it with this workaround:
User Authentication Failed Workaround
Add the user directly in DocuSign > Admin > Users
Have the user complete the activation steps.
Go to the Object Manager
Go to Users
Go to Page Layouts and edit the User Details Page Layout
Add the DocuSign Username Field (might be labeled DSProSFUsername), to the layout
Login directly to DocuSign
Go to Admin
Go to Users
Click on the affected User and copy their API Username
Go back to Salesforce and Edit the User Record
Paste in the API Username into that DocuSign Username field.
Add the DocuSign User or DocuSign Administrator Permission Set Assignment Manually
Go to the Apex Troubleshooting page here: https://support.docusign.com/articles/How-do-I-troubleshoot-issues-with-DocuSign-for-Salesforce-configurations-settings
Run a Force User Sync.

CakeDC/Users new role

I'm using the CakeDC/Users plugin and want add other user roles.
Right now I have the both superuser and user roles.
I'm doing the permissions control in the permissions.php.
I'm also overwriting the layout files. Tried initially force the role field in the form, but the plugin write the user role in the controllers.
As steinkel posted in this issue: https://github.com/CakeDC/users/issues/513
You must add this line after the pathEntity in /vendor/cakedc/user/src/Controller/Traits/SimpleCrudTrait.php
$entity->role = $this->request->data('role');
Then configure your form to pass the role field. In my case, I passed this information with a select box.

Salesforce Community User creation - Password Setting

This question is related to the post in the below link
automate creating communities user
If the community user can be created with the automated process, how is the password for the user is set?
Generally, If community user is created, an email will be sent to the email id with a set password link and user has to click the link and set the password manually, even after creating the user automatically.
My question, is there a way to automate the password setting also? or can we set the default password while community user creation and then override the password using the System class method named 'SetPassword' for the community user?
Thanks
If you want control over user passwords you will need to set up some sort of delegated authentication.
This article on the dev forum has many details about provisioning community users. This blog post has details on required fields. Info from SFDC on SSO.

Resources