找不到指定的用户域\\ UserName. [英] The specified user domain\\UserName could not be found.

查看:105
本文介绍了找不到指定的用户域\\ UserName.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用JavaScript将简单用户添加到子站点中的现有SharePoint组时,用户添加成功.我正在使用下面的代码片段添加用户.

When I add simple user to existing SharePoint group in sub site using JavaScript, user added successfully. I am using below code snippet to add user.

在我的场景中,首先,我以编程方式在PreSaveAction上创建子站点.之后,我要创建SP Group&以编程方式向该SP组分配完全控制"权限.

In my scenario, Firstly, I am creating subsite programatically on PreSaveAction. After that I am creating SP Group & assigning Full Control permission to that SP Group programatically.

因此,当执行我的代码以将用户添加到新创建的SharePoint组时,出现错误消息找不到指定的用户域\\ UserName."

So, when my code is executed to add user to newly created SharePoint Group, I am getting error as "The specified user domain\\UserName could not be found."

我不知道为什么会这样.是SharePoint OOB行为还是bug?

I don't know why this is happening. Is it a SharePoint OOB behavior or bug?

我们将为您提供及时的帮助.

Immediate help would be appreciated.

谢谢.

此致

Sandip

推荐答案

您遇到的问题是代码逻辑.

使用SharePoint ClientContext创建组时,只有在调用executeQueryAsync之前,操作才会提交.

尝试延迟您的逻辑,例如:

            create group

                        create user

如果您将来需要帮助,最好提供您的代码.


这篇关于找不到指定的用户域\\ UserName.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆