如何在sharepoint 2013中的多个组中添加1个用户

时间:2017-05-12 06:38:13

标签: sharepoint sharepoint-2010 sharepoint-2013 sharepoint-2007 csom

我想在sharepoint 2013中的多个组中添加1个用户。 这个用于在1组添加1个用户的代码对我有用。

 Dim clientContext As New ClientContext("http://Server/DomainName/")
        ' Get the SharePoint web  
        Dim web As Web = clientContext.Web
        Dim user As User = web.EnsureUser("FirstName LastName")
        ' Get the specific site group by name  
        Dim group As Group = web.SiteGroups.GetByName("Managment")
        ' Add a user to the specific group  
        group.Users.AddUser(user)
        ' Execute the query to the server  
        clientContext.ExecuteQuery()

现在我想在批量组中添加用户。

我如何在这里调用数组。

' Get the specific site group by name  
            Dim group As Group = web.SiteGroups.GetByName("Managment")

我正在获取具有所有组名的数组。现在如何将数组中的组添加为集合类型。

1 个答案:

答案 0 :(得分:0)

使用相同的代码并创建一个循环?

或使用SPDash

相关问题