Unable to Create a systemuser in Dynamics CRM 365 online

折月煮酒 提交于 2019-12-11 18:14:35

问题


On update field of contact record I want to create a systemuser(user) in dynamics crm 365 online.but I’m getting error like "usersettings With Id = 5fe33120-607f-e811-a95c-000d3af29269 Does Not Exist"

This is the below code I'm trying to create a user

Entity getEntity = (Entity)context.InputParameters["Target"];
                string str = getEntity.Attributes["new_isaeon"].ToString();

                if (str != null && str == "True")
                {
                    // http://localhost:51625/api/Users
                    Entity sysuser = new Entity("systemuser");
                    sysuser.Attributes["fullname"] = "hsk";
                    sysuser.Attributes["internalemailaddress"] = "projectservice_9@crmdemo.dynamics.com";
                    sysuser.Attributes["domainname"] = "projectservice_9@crmdemo.dynamics.com";
                    Guid getGuid = new Guid("700F2217-786A-E811-A95A-000D3AF2793E");
                    sysuser.Attributes["businessunitid"] = new EntityReference("businessunit", getGuid);
                    sysuser.FormattedValues["accessmode"] = "Read-Write";
                    Guid getuserid = service.Create(sysuser);

                }

can anyone help me on this thanks.


回答1:


In Dynamics 365 CRM online, system users record creation/enabling flow happens from O365 Admin portal end. Read more

Steps go like this:
1. Security group has to be created in Active directory & mapped in O365 Admin portal for any CRM Org
2. Users has to be added in that AD Security group
3. All the users from SG will be replicated as system users in CRM instance
4. In O365 Admin portal, on assigning CRM license (Basic/Pro) against the user - the system user record will be enabled in CRM
5. In CRM side, we will assign Security role to complete user on-boarding

We cannot create system user using SDK directly because of above manual steps outside CRM online. Can be created using PowerShell like answered in community.



来源:https://stackoverflow.com/questions/51172526/unable-to-create-a-systemuser-in-dynamics-crm-365-online

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!