Questions tagged [spuser]

Represents a user in Microsoft SharePoint Foundation.

Filter by
Sorted by
Tagged with
17 votes
3 answers
24k views

How do I convert SPUser to SPFieldUser?

I have a field in a list that accepts an SPFieldUser object. I have an SPUser object that I would like to populate that field with, but I cannot implicitly convert from one to the other. How would I ...
Meyer Denney's user avatar
  • 2,864
12 votes
4 answers
10k views

What is the best way to determine if CurrentUser is System Account?

Traditionally I use: if (web.CurrentUser.Name == "System Account") Is there a possibility the System Account Name could be something other then "System Account". Is there a more reliable way to ...
Meyer Denney's user avatar
  • 2,864
8 votes
5 answers
28k views

How do I get SPUser Object?

I'm unable to get SPUsers/user. As an example I have here a User (Approver): <User ID=\"31\" Sid=\"\" Name=\"Approver\" LoginName=\"i:0#.w|domain\\approver\" Email=\"[email protected]\" Notes=\"...
George Norberg's user avatar
5 votes
4 answers
11k views

EnsureUser() will return the following error "The specified user could not be found. "

I am working on developing a server side event receiver inside sharepoint on-premises farm 2013. Inside the code i have the following, which will retrieve a string from a drop down list column ...
John John's user avatar
5 votes
5 answers
20k views

Error in Web.EnsureUser(user) :- User Not Found

Hey Friends I am trying to develop a web part in that I am fetching the user name. But doing this I am getting the error that User cannot be found. But the main thing is that in the line where I ...
Rahul Gokani's user avatar
  • 1,074
5 votes
6 answers
1k views

SharePoint 2007 : How to sign out user?

I've an application build on SharePoint 2007 platform, the problem is in Mozilla FireFox, the sign out button does not successfully sign out the current login user, I believe SharePoint 2007 is not ...
sams5817's user avatar
  • 423
5 votes
1 answer
620 views

Custom Web Service not cannot find User

I have created a Custom Web Service for my .NET application that performs various functions against a Sharepoint 2010 site. I use a standard function to run each function as an impersonated user (so ...
Andrew's user avatar
  • 103
5 votes
1 answer
2k views

How to remove "orphaned" users from a site collection?

We recently performed a domain migration where we migrated several forests and domains into a single domain. From speaking to the AD admins, this was done using a tool from Quest and it maintained SID ...
shufler's user avatar
  • 1,603
4 votes
2 answers
1k views

Convert this display name to SPUser

How to convert this display name to SPUser type. My input is Sivakumar, Piratheban (ext)(domain\user)
Sivakumar Piratheeban's user avatar
4 votes
2 answers
482 views

SPUser.Groups is empty

I have an SPUser object generated from the currently logged in user via SPContext.Current.Web.CurrentUser however user.Groups is coming back empty. I checked the group, the user is in the group. ...
James Grizzle's user avatar
4 votes
2 answers
13k views

Get User Profile from email address

I was using SPUtility.ResolvePrincipal to resolve the email address but it only seems to work if the user is already in the User Information List. Is there any way I can resolve users based on email ...
James Grizzle's user avatar
4 votes
0 answers
1k views

How to get SPUser from FBA login name

I have a Form Based Authentication login name login_name how to get an SPUser object for that login name. I have tried the Web.EnsureUser(string.Format("c:0-.f|role|{0}", name)); but it gives me ...
Nitin Chhajer's user avatar
3 votes
6 answers
2k views

Logged in user name in SharePoint 2010

I am trying to retrieve the display name('firstname lastname') of a user who logs in the SharePoint site. When I log into my SharePoint site I could see at the top right --'domain/user name'. So when ...
SandeshR's user avatar
  • 1,992
3 votes
4 answers
19k views

How to know the exact loginname of the user who operates as system account?

If current logged user operates as "System Account", SPContext.Current.Web.CurrentUser.LoginName will return "sharepoint\system", so I want to know the exact loginname of the user. Here is what I ...
Xiaodan Mao's user avatar
3 votes
4 answers
4k views

How to know SPUser.LoginName is System Account?

I am trying get the Modified By column value. And I want to check my PeoplePicker control contains the value same as the Modified By column value. I am stuck in the problem that Modified By column'...
Rahul Gokani's user avatar
  • 1,074
3 votes
2 answers
8k views

Trying to get user's manager: Getting SPServiceContext with SiteSubscriptionId of {00000000-0000-0000-0000-000000000000}

I am trying to get a user's manager with this code: SPSecurity.RunWithElevatedPriviliges(delegate { SPSite site = new SPSite(SPContext.Current.Site.Url); SPServiceContext context = ...
Jeremy's user avatar
  • 313
3 votes
2 answers
4k views

Get all groups for a specific web site (NOT SITE COLLECTION) using powershell?

I would like to know how to get all groups of a specific web site using powershell. I do know that all groups are defined at the site collection level but when browsing in a specific web, it only ...
ameliapond's user avatar
3 votes
2 answers
13k views

Determine if SPPrincipal is SPUser, SPGroup or AD User

Context I have a List<SPPrincipal> that is a mix of SPGroup, SPUser and AD Users. Problem I'm trying to find out how to determine if an SPPrincipal I have is an SPUser, SPGroup or an AD user....
user avatar
3 votes
4 answers
15k views

How to find permission level for specific user using visual studio?

How to find permission level for specific user in site collection and subsite using visual studio?
Hitesh Chandegara's user avatar
3 votes
1 answer
1k views

Force create SPUser for disabled AD account

I am trying to get SharePoint to create an SPUser for a disabled active directory account. The reason for this is that I am archiving items across site collections. As the items are copied I am ...
LukeP's user avatar
  • 299
3 votes
0 answers
270 views

Reliable way to get user domain from SPUser

I feel a bit silly that I can't think of a reliable way to get this information. Most SPUsers, but not all, now have claims LoginNames. This makes parsing the domain name a little bit tricky. Is ...
Nacht's user avatar
  • 1,231
2 votes
3 answers
17k views

How to convert string into SPUser?

I have a string "System Account", how can I convert the string into SPUser? I've tried SPContext.Current.Web.EnsureUser("System Account") and also web.AllUser["System Account"] but hit error. Please ...
sams5817's user avatar
  • 423
2 votes
2 answers
8k views

How to remove user from Sharepoint Group using JavaScript?

I want to add and remove user to/from Office 365 Group. I tried using C# code but got error : "User does not exist or is not unique". After searching on the web I can't find solution.So i tried ...
Ronak Patel's user avatar
  • 3,261
2 votes
2 answers
980 views

Get all SPUser groups?

I have a SPUser and I want to get all the user groups in which the SPUser exists. How can i get all the SPGroups containing the SPUser programatically?. Sample codes and useful links would be very ...
anantharengan's user avatar
2 votes
2 answers
3k views

Email property is empty on SPUser object, how to fill?

I have a piece of code which gets the email address of a SPUser object. The email property is empty. Where I can fill the email address of this user? Is it in SharePoint or somewhere in AD? I dont ...
Ola's user avatar
  • 4,405
2 votes
2 answers
828 views

Add user to SPGroup not working properly

I have wrote following code to add users to SharePoint group. It works fine and add user to the group first time. But if I remove the user from site manually and re run the app there is no exception ...
Sivakumar Piratheeban's user avatar
2 votes
1 answer
4k views

Convert user id to user name in a single rest query that gets list items

So I get some items from a list via a rest query, and in the Creator field I get an ID. I want to display the name of the user and not the ID. Calling the GetUserByID isn't an option because it might ...
Sharon Dorot's user avatar
2 votes
2 answers
856 views

Is possible to rename a SPUser(IsDomainGroup) LoginName?

I want to rename SPPrincipals that are ADGroups. I've tried with $SPFarm = Get-SPFarm #$SPFarm.MigrateGroup("loginName", "newLoginName") $SPFarm.MigrateUserAccount("loginName", "newLoginName", $...
fallout's user avatar
  • 1,015
2 votes
2 answers
3k views

Adding SPUsers to SPGroups programmatically changes User ID

In a SharePoint Online (Office 365) environment we created a Sandboxed WebPart to put SPUsers in SPGroups. The SPGroup is created on rootlevel and has been given permissions on a subsite. This Subsite ...
Cas van Iersel's user avatar
2 votes
1 answer
3k views

Get all users from active directory to sharepoint

I have to populate my autocomplete PeopleEditor-like control based on brililant ASPTokenInput with all people from my AD domain. Reflecting PeopleEditor shows a real mess in their Active Directory ...
Bassist's user avatar
  • 41
2 votes
3 answers
7k views

How to get claims from SPUser object

Is it possible to read claims by using the SPUser object only? STS is used as claimsprovider. All examples I have found use: var claimsPrincipal = Page.User as IClaimsPrincipal; claimsIdentity = (...
moregardh's user avatar
1 vote
2 answers
1k views

spfielduservaluecollection.remove not working

I want to remove the user from the list item from the column of type person or group and it is multi-valued. My code is: private void DeleteUserFromList(SPUser userDeleted, string fieldName,...
users1100's user avatar
  • 3,230
1 vote
3 answers
3k views

Issues with SPPrincipals on SP2013

I'm having some troubles with getting SPPrincipals, was hoping if anybody would point me to the right direction. Here is the scoop: I need to grant permissions to SPItem. I get SPUser: SPUser user =...
Victor Shostak's user avatar
1 vote
2 answers
4k views

Getting SPUser Last login date / time

Is there a way to get the last login time from an SPUser object? I don't want the last login time to Active Directory, but specifically for the sharepoint site.
BlueBird's user avatar
  • 1,850
1 vote
6 answers
6k views

How to check if the current user is equal to some spuser?

I am using sp2010. I get the current user from the context. And I would like to check if it is equal to the creator of an list item. But the code says it is not equal. Why? Is there some other ...
Ola's user avatar
  • 4,405
1 vote
2 answers
3k views

SPUserCollection class

So I created a custom list with a person field. The person field has multiple names of people. What I want to do is get an Item' [person field] data and put it into a SPUserCollection, I tried to do ...
will's user avatar
  • 329
1 vote
1 answer
1k views

Can we use distribution lists inside sharepoint 2016 "Person and Group" column type

I have created a new site column of type "Person and group" inside my team site collection inside sharepoint 2016. I configure it to retrieve users and groups from active directory, as ...
John John's user avatar
1 vote
1 answer
2k views

Get SPUser by passing Email address

i have an Email address of particular user. Now i want the SP username of that particular email address programatically. Thanks.
Ishani's user avatar
  • 179
1 vote
1 answer
4k views

Remove user from SPFieldUserValueCollection

I have a "person or group" type column in my calendar list as "Participants". I need to add and remove users from this column. Adding users works fine. When trying to remove a user it does not get ...
Shaamil's user avatar
  • 708
1 vote
1 answer
608 views

How to find permission level date(Last Modifed or Created) for a user and group?

How to find permission level date(Last Modifed or Created) which applying permission level for a user and group?
Hitesh Chandegara's user avatar
1 vote
1 answer
3k views

How to map Claims to SPUser object?

I have SharePoint 2010 with Claims Authentication (SAML / AD FS v2). I have made an incoming mapping for UPN, Role, CommonName. I want to show the user's "DisplayName" in the right corner (the Name on ...
user avatar
1 vote
1 answer
185 views

SPFieldUserValue.User.Email giving an deleted email address on prod

Am very new to SharePoint. I have got stuck into a strange issue. On Prod server SPFieldUserValue.User.Email giving an email address which as been deleted. Actually, there were 2 users with the same ...
shoab's user avatar
  • 673
1 vote
3 answers
2k views

Sharepoint Online JavaScript convert from SPUser to SPFieldUser and get name

How can I get full name from SPUser? I got him from get_currentUser() from web context. And how can I convert from SPUser to SPFieldUser in JS? EDIT: I need it to compare, I get from list field ...
Rhonin's user avatar
  • 163
1 vote
1 answer
342 views

Save conflict error when handling user deletion from group programmatically

I have a site in which unique permission group are there. I want to update the list item as per the changes made in the user group in site, i.e. if user is removed from the site user group then the ...
users1100's user avatar
  • 3,230
1 vote
2 answers
922 views

Sort SPList on derived value of e.g. SPFieldUser column

What I want to achieve is: get a bunch of SPListItems from an SPList, using SPQuery, and have the items ordered by an SPFieldUser column. Just referencing the SPFieldUser column appears to sort on the ...
claesv's user avatar
  • 305
1 vote
1 answer
232 views

get creation Date of spuser

I need to get all the users that are added to spgroup "XX" on specific date . $url = "https://spsite.com $User = Get-SPUser -web $url -Group "XX" $User | Select Userlogin,Groups,DisplayName,Email,...
Imen Turki's user avatar
  • 2,183
1 vote
1 answer
1k views

How to display SPUser with presence indicator and contact card in custom webpart

I am trying to find a way to display two columns from a list item, values in the both the columns are of type SPFieldUser. Looking for a way to display their contact card just like the way it is ...
UP26's user avatar
  • 23
1 vote
1 answer
5k views

SPUser field is returning only ID in REST

I have my multi-value SPUser field in my list. When accessing it via REST, I am only able to retrieve the ID of the SPUsers. In the result of the REST, the SPUser field was also appended by an Id in ...
Joe's user avatar
  • 483
1 vote
2 answers
335 views

Bind all users of office 365 except system users using C#

How to bind all the users of Sharepoint(office 365) except system users like : "System Account", "NT AUTHORITY\authenticated users", "_SPOCacheFull", "YLO001_spocrwl_142_11094". I want only ...
Ronak Patel's user avatar
  • 3,261
1 vote
2 answers
3k views

Unable to get user field value in event receiver's afterproperties

I have a document library in which there is one field approver (multi - value). There is an event receiver for item updating of the document library that I want to validate user while changing the ...
users1100's user avatar
  • 3,230