How set a password for the user in c# SDK

How to set a password for the user, were to select 2 options 1)set by the user and 2)set by admin
am using okta c#sdk.
My code:
var CurrentUser = usersClient.Add(user);
var CurrentUser1 = usersClient.Activate(user, true);
where to set the password when creating a user. In my scenario, we are sending a mail to the end-user while creating the send the password.
and where to give the option of password change after first login

Thanks in Advance

Thank you,

Hi @praveen,

To force the user to change password at the next login, you will need to to pass a query parameter nextLogin=changePassword to the create user call.
I haven’t tried it out but this is the method used to create the user -

Notice the Okta.Sdk.UserNextLogin nextLogin argument to this method. You will have to set it accordingly.