In my project I am creating new subsite and adding documents to it. I need to assign permissions to the documents. As the subsite is newly created there is no user or groups are added to it. I need to get all users and groups from Sharepoint online and add them to SiteGroups and SiteUsers. How can I get all users/groups from the sharepoint online?
Please note: I am not searching for SiteGroups and SiteUsers.
Web f_web = null; WebCreationInformation f_webCrInfo = null; f_webCrInfo = new WebCreationInformation(); f_webCrInfo.Description = "My new substie"; f_webCrInfo.Title = "Newsubsite"; f_webCrInfo.WebTemplate = "STS"; f_webCrInfo.Url = "subsite"; f_webCrInfo.UseSamePermissionsAsParentSite = true; f_web = p_Context.Web.Webs.Add(f_webCrInfo); p_Context.Load(f_web, website => website.Fields, website => website.ServerRelativeUrl, website => website.Url, website => website.Id, website => website.Language, website => website.RegionalSettings, website => website.RoleAssignments, website => website.RoleDefinitions); p_Context.ExecuteQuery();