New answers tagged

3

If you only want to add a user to a group, then do this: ClientContext client = new ClientContext("SiteURL"); Web web = client.Web; Group group = web.SiteGroups.GetByName("test Members"); User user = web.EnsureUser("mydomain\\user"); // Note the double backslash. // Add user to group. group.Users.AddUser(user); client.ExecuteQuery(); There is no need to ...


1

Go to Site Sittings page > Site Permissions page Find the SPGroup you have added there, Click on 'Edit User Permissions' in the ribbon You will be able to find the permission set for that group in the site Important: If you were unable to find the SPGroup in your Site Permissions page, the you have just created the group and you have not set permissions ...


3

This code should work: (web is a variable that references the web object) SPFieldUserValue value = new SPFieldUserValue(web, item["AssignedTo"].ToString()); if (value) { assignToUser = value.User; }


2

You can try below code to get SPUser in AssignedTo columns for specific item. If(task["Assigned To"] != null) { string fieldValue = Convert.ToString(task["Assigned To"]); SPFieldUserValue assignedTo = (SPFieldUserValue) task.Fields["Assigned To"].GetFieldValue(fieldValue); }


2

Try this SPFieldUserValue userField = item.Fields["AssignedTo"] as SPFieldUser; string userName = item["AssignedTo"].ToString(); SPFieldUserValue fieldValue = (SPFieldUserValue)userField.GetFieldValue(userName); SPUser user = fieldValue.User; Taken from http://ethan-deng.blogspot.com/2013/03/get-spuser-from-user-column-there-are.html


2

You can try below code, using (SPSite siteCol = new SPSite("http://server/sites/Contoso")) { using (SPWeb web = siteCol.RootWeb) { SPList list = web.GetList("/sites/Contoso/Lists/Books"); SPListItem item = list.GetItemByIdSelectedFields(3, "Title", "ISBN", "Retail_x0020_Price"); String bookISBN = ...


0

I have found that it is necessary to add the username and password to Credential Manager in order for this to work. I navigated to the Sharepoint web address and was prompted for username and password, make sure to check the box to remember the credentials. Then, when I run the net use command, I am not prompted for username and password at all and receive ...


0

I have found something that worked for me. It is kind of forcing it to sync again: Get-SPUser –Web http://sharepointsite | Set-SPUser –SyncFromAD You will probably get some error like Set-SPUser : Cannot get the full name or e-mail address of user "c:0(.s|true"., but nothing to worry about


0

Here you able find the URL with clear explanation. http://www.dotnetsharepoint.com/2016/06/how-to-restrict-users-for-creating.html


0

According to IFABC Global Web Standards, a unique visitor is an IP address plus a further identifier (such as user name, user agent, or a cookie). If you want to know how many daily unique visitors there are, you should go to the Site Collection Web Analytics Reports – Number of Daily Unique Visitors page. The Summary page is nothing more than a summation of ...


0

For me you have to use an SPSiteDataQuery to perform operation across multiple webs in the same site collection. Here is doc from msdn with working example : MSDN Artcile


1

This is what the Work Management Service is for. On the User Profile Tasks page it accumulates the tasks from SharePoint, Project Server Sites and Exchange 2013 (if you have that and it's connected). Warning though, it has been removed from SharePoint 2016 and Office 365. Reference: http://social.technet.microsoft.com/wiki/contents/articles/12525....


0

Please check below things: You have not set target audience for the top navigation bar In Master Page, if you have used SPSecurityTrim Control then it's permission and scope Try to give same privileges as you are having to the user who face same issue. Let me know outputs of all above steps to understand your issue.


1

It will not work as it is already mentioned in Codeplex comments & there is no solution mentioned over there as well. You need to make standard ajax call but it will give you XML with having all user's information in it using below code (As you required SPUser so i cleared the output). $.ajax({ url: "/_api/lists/getbytitle('User Information List')/...



Top 50 recent answers are included